Skip to content

Commit 218749d

Browse files
authored
.NET v3: SESv2 Coupon Newsletter Workflow (#6459)
1 parent 9ccda8f commit 218749d

File tree

10 files changed

+1531
-0
lines changed

10 files changed

+1531
-0
lines changed

.doc_gen/metadata/sesv2_metadata.yaml

+83
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
sesv2_CreateContactList:
22
languages:
3+
.NET:
4+
versions:
5+
- sdk_version: 3
6+
github: dotnetv3/SESv2
7+
excerpts:
8+
- description:
9+
snippet_tags:
10+
- SESWorkflow.dotnetv3.SESv2Wrapper.CreateContactList
311
Rust:
412
versions:
513
- sdk_version: 1
@@ -30,6 +38,14 @@ sesv2_CreateContactList:
3038
sesv2: {CreateContactList}
3139
sesv2_CreateContact:
3240
languages:
41+
.NET:
42+
versions:
43+
- sdk_version: 3
44+
github: dotnetv3/SESv2
45+
excerpts:
46+
- description:
47+
snippet_tags:
48+
- SESWorkflow.dotnetv3.SESv2Wrapper.CreateContact
3349
Rust:
3450
versions:
3551
- sdk_version: 1
@@ -84,6 +100,14 @@ sesv2_ListContactLists:
84100
sesv2: {ListContactLists}
85101
sesv2_ListContacts:
86102
languages:
103+
.NET:
104+
versions:
105+
- sdk_version: 3
106+
github: dotnetv3/SESv2
107+
excerpts:
108+
- description:
109+
snippet_tags:
110+
- SESWorkflow.dotnetv3.SESv2Wrapper.ListContacts
87111
Rust:
88112
versions:
89113
- sdk_version: 1
@@ -114,6 +138,14 @@ sesv2_ListContacts:
114138
sesv2: {ListContacts}
115139
sesv2_SendEmail:
116140
languages:
141+
.NET:
142+
versions:
143+
- sdk_version: 3
144+
github: dotnetv3/SESv2
145+
excerpts:
146+
- description:
147+
snippet_tags:
148+
- SESWorkflow.dotnetv3.SESv2Wrapper.SendEmail
117149
Java:
118150
versions:
119151
- sdk_version: 2
@@ -164,6 +196,14 @@ sesv2_SendEmail:
164196
sesv2: {SendEmail}
165197
sesv2_CreateEmailIdentity:
166198
languages:
199+
.NET:
200+
versions:
201+
- sdk_version: 3
202+
github: dotnetv3/SESv2
203+
excerpts:
204+
- description:
205+
snippet_tags:
206+
- SESWorkflow.dotnetv3.SESv2Wrapper.CreateEmailIdentity
167207
Java:
168208
versions:
169209
- sdk_version: 2
@@ -194,6 +234,14 @@ sesv2_CreateEmailIdentity:
194234
sesv2: {CreateEmailIdentity}
195235
sesv2_CreateEmailTemplate:
196236
languages:
237+
.NET:
238+
versions:
239+
- sdk_version: 3
240+
github: dotnetv3/SESv2
241+
excerpts:
242+
- description:
243+
snippet_tags:
244+
- SESWorkflow.dotnetv3.SESv2Wrapper.CreateEmailTemplate
197245
Java:
198246
versions:
199247
- sdk_version: 2
@@ -224,6 +272,14 @@ sesv2_CreateEmailTemplate:
224272
sesv2: {CreateEmailTemplate}
225273
sesv2_DeleteContactList:
226274
languages:
275+
.NET:
276+
versions:
277+
- sdk_version: 3
278+
github: dotnetv3/SESv2
279+
excerpts:
280+
- description:
281+
snippet_tags:
282+
- SESWorkflow.dotnetv3.SESv2Wrapper.DeleteContactList
227283
Java:
228284
versions:
229285
- sdk_version: 2
@@ -254,6 +310,14 @@ sesv2_DeleteContactList:
254310
sesv2: {DeleteContactList}
255311
sesv2_DeleteEmailIdentity:
256312
languages:
313+
.NET:
314+
versions:
315+
- sdk_version: 3
316+
github: dotnetv3/SESv2
317+
excerpts:
318+
- description:
319+
snippet_tags:
320+
- SESWorkflow.dotnetv3.SESv2Wrapper.DeleteEmailIdentity
257321
Java:
258322
versions:
259323
- sdk_version: 2
@@ -284,6 +348,14 @@ sesv2_DeleteEmailIdentity:
284348
sesv2: {DeleteEmailIdentity}
285349
sesv2_DeleteEmailTemplate:
286350
languages:
351+
.NET:
352+
versions:
353+
- sdk_version: 3
354+
github: dotnetv3/SESv2
355+
excerpts:
356+
- description:
357+
snippet_tags:
358+
- SESWorkflow.dotnetv3.SESv2Wrapper.DeleteEmailTemplate
287359
Java:
288360
versions:
289361
- sdk_version: 2
@@ -318,6 +390,17 @@ sesv2_NewsletterWorkflow:
318390
synopsis: '&SESv2; newsletter workflow.'
319391
category: Scenarios
320392
languages:
393+
.NET:
394+
versions:
395+
- sdk_version: 3
396+
github: dotnetv3/SESv2
397+
excerpts:
398+
- description: Run the workflow.
399+
snippet_tags:
400+
- SESWorkflow.dotnetv3.NewsletterWorkflow
401+
- description: Wrapper for service operations.
402+
snippet_tags:
403+
- SESWorkflow.dotnetv3.SESv2Wrapper
321404
Java:
322405
versions:
323406
- sdk_version: 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34714.143
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sesv2Scenario", "Sesv2Scenario\Sesv2Scenario.csproj", "{79AE1B89-241B-4450-B1EB-9AAF79DA558C}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sesv2Tests", "Sesv2Tests\Sesv2Tests.csproj", "{E7E4EB7C-C785-4E8C-9E68-19825736F053}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{79AE1B89-241B-4450-B1EB-9AAF79DA558C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{79AE1B89-241B-4450-B1EB-9AAF79DA558C}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{79AE1B89-241B-4450-B1EB-9AAF79DA558C}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{79AE1B89-241B-4450-B1EB-9AAF79DA558C}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{E7E4EB7C-C785-4E8C-9E68-19825736F053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{E7E4EB7C-C785-4E8C-9E68-19825736F053}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{E7E4EB7C-C785-4E8C-9E68-19825736F053}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{E7E4EB7C-C785-4E8C-9E68-19825736F053}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {7DE7AD4A-0683-440E-B2B7-0D91C5402601}
30+
EndGlobalSection
31+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Amazon SES v2 Coupon Newsletter Workflow
2+
3+
## Overview
4+
5+
This workflow demonstrates how to use the Amazon Simple Email Service (SES) v2 to send a coupon newsletter to a list of contacts. It covers the following key steps:
6+
7+
1. **Prepare the Application**
8+
9+
- Create a verified email identity for the "send/reply" email addresses.
10+
- Create a contact list to store the newsletter subscribers.
11+
12+
2. **Gather Subscriber Email Addresses**
13+
14+
- Allow subscribers to sign up for the newsletter by providing their email addresses.
15+
- Send a welcome email to each new subscriber.
16+
17+
3. **Send the Coupon Newsletter**
18+
19+
- Create a template for the coupon newsletter.
20+
- Retrieve the list of contacts (subscribers).
21+
- Send individual emails with the coupon newsletter template to each subscriber.
22+
- Include Unsubscribe links and headers to follow bulk email best practices.
23+
24+
4. **Monitor and Review**
25+
26+
- Review dashboards and metrics in the AWS console for the newsletter campaign.
27+
- Because this workflow minimizes the number of email addresses necessary by utilizing subaddresses to show the features of SES Contact Lists, it is likely an email provider will mark the messages as Spam. Check your spam folder to ensure they sent.
28+
29+
5. **Clean up**
30+
31+
- Delete the template.
32+
- Delete the contact list.
33+
- Optionally delete the sender verified email identity.
34+
35+
## ⚠ Important
36+
37+
* Running this code might result in charges to your AWS account.
38+
* Running the tests might result in charges to your AWS account.
39+
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
40+
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).
41+
42+
## Scenario
43+
44+
### Prerequisites
45+
46+
For general prerequisites, see the [README](../../../README.md) in the `dotnetv3` folder.
47+
48+
### Resources
49+
50+
Before running this workflow, ensure you have:
51+
52+
- An AWS account with proper permissions to use Amazon SES v2.
53+
- (Optional) A verified email identity (domain or email address) in Amazon SES for the Sending address.
54+
- This will be created during the workflow if it does not already exist.
55+
- (Optional, if the account is in the SES Sandbox) A verified destination address.
56+
- This will NOT be created during the workflow.
57+
58+
### Instructions
59+
60+
After the example compiles, you can run it from the command line. To do so, navigate to
61+
the folder that contains the .sln file and run the following command:
62+
63+
```
64+
dotnet run
65+
```
66+
67+
Alternatively, you can run the example from within your IDE.
68+
69+
## Additional resources
70+
71+
- [Amazon SES v2 API Developer Guide](https://docs.aws.amazon.com/ses/latest/dg/Welcome.html)
72+
- [Amazon SES v2 API API Reference](https://docs.aws.amazon.com/ses/latest/APIReference-V2/Welcome.html)
73+
- [SDK for .NET Amazon SES v2 API reference](https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/Sesv2/NSesv2.html)
74+
75+
---
76+
77+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)