|
121 | 121 | return Results.Ok("Email and SMS sent successfully."); |
122 | 122 | }); |
123 | 123 |
|
124 | | -app.MapGet("/send/email/html-body", async (IEmailService emailService) => |
| 124 | +app.MapGet("/send/email/html-body/outlook", async (IEmailService emailService) => |
125 | 125 | { |
126 | 126 | var email = new EmailMessage |
127 | 127 | { |
|
135 | 135 | return Results.Ok("Email sent successfully."); |
136 | 136 | }); |
137 | 137 |
|
138 | | -app.MapGet("/send/email/html-body/with-response", async (IEmailService emailService) => |
| 138 | +app.MapGet("/send/email/html-body/gmail", async (IEmailService emailService) => |
| 139 | +{ |
| 140 | + var email = new EmailMessage |
| 141 | + { |
| 142 | + Recipients = ["[email protected]"], |
| 143 | + Subject = "Some subject", |
| 144 | + Body = EmailTemplates.AddEmailAddressTemplate("Test", "Test", "https://www.google.com/"), |
| 145 | + IsBodyHtml = true, |
| 146 | + Channel = EmailChannels.TransactionalSender |
| 147 | + }; |
| 148 | + await emailService.SendAsync(email); |
| 149 | + return Results.Ok("Email sent successfully."); |
| 150 | +}); |
| 151 | + |
| 152 | +app.MapGet("/send/email/html-body/with-response/outlook", async (IEmailService emailService) => |
139 | 153 | { |
140 | 154 | var email = new EmailMessage |
141 | 155 | { |
|
149 | 163 | return Results.Ok(response); |
150 | 164 | }); |
151 | 165 |
|
| 166 | +app.MapGet("/send/email/html-body/with-response/gmail", async (IEmailService emailService) => |
| 167 | +{ |
| 168 | + var email = new EmailMessage |
| 169 | + { |
| 170 | + Recipients = ["[email protected]"], |
| 171 | + Subject = "Some subject", |
| 172 | + Body = EmailTemplates.AddEmailAddressTemplate("Test", "Test", "https://www.google.com/"), |
| 173 | + IsBodyHtml = true, |
| 174 | + Channel = EmailChannels.TransactionalSender |
| 175 | + }; |
| 176 | + var response = await emailService.SendAsync(email); |
| 177 | + return Results.Ok(response); |
| 178 | +}); |
| 179 | + |
152 | 180 | app.MapGet("/send/email/multiple-recipients/html-body", async (IEmailService emailService) => |
153 | 181 | { |
154 | 182 | var email = new EmailMessage |
|
0 commit comments