-
Notifications
You must be signed in to change notification settings - Fork 3
gl-dotnet-email changes for Cc, Bcc, ReplyTo, and attachments #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
2ae944b
6a9a2fc
28b5117
52d1bcb
b241f9a
35d7331
36618ae
08fb23e
d9198ab
2a1cf73
9635f2a
19bbf69
3d2e989
b5dbc89
2e4b9e1
90d4f8d
2493e33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace GeekLearning.Email | ||
namespace GeekLearning.Email | ||
{ | ||
public interface IEmailAddress | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
namespace GeekLearning.Email | ||
namespace GeekLearning.Email | ||
{ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
using MimeKit; | ||
|
||
public interface IEmailProvider | ||
{ | ||
Task SendEmailAsync(IEmailAddress from, IEnumerable<IEmailAddress> recipients, string subject, string bodyText, string bodyHtml); | ||
Task SendEmailAsync( | ||
IEmailAddress from, | ||
IEnumerable<IEmailAddress> recipients, | ||
string subject, | ||
string bodyText, | ||
string bodyHtml | ||
AttachmentCollection attachments=null); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,20 @@ | |
|
||
public interface IEmailSender | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should be additional overloads using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a thought. But there needs to be a solid way to link an AddressTarget to an email address. And how does it look if we have multiple email addresses in the call? |
||
{ | ||
Task SendEmailAsync(string subject, string message, AttachmentCollection attachments, params IEmailAddress[] to); | ||
|
||
Task SendEmailAsync(string subject, string message, params IEmailAddress[] to); | ||
|
||
Task SendEmailAsync(IEmailAddress from, string subject, string message, params IEmailAddress[] to); | ||
|
||
Task SendEmailAsync(IEmailAddress from, string subject, string message, AttachmentCollection attachments, params IEmailAddress[] to); | ||
|
||
Task SendTemplatedEmailAsync<T>(string templateKey, T context, AttachmentCollection attachments, params IEmailAddress[] to); | ||
|
||
Task SendTemplatedEmailAsync<T>(string templateKey, T context, params IEmailAddress[] to); | ||
|
||
Task SendTemplatedEmailAsync<T>(IEmailAddress from, string templateKey, T context, params IEmailAddress[] to); | ||
|
||
Task SendTemplatedEmailAsync<T>(IEmailAddress from, string templateKey, T context, AttachmentCollection attachments, params IEmailAddress[] to); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IEmailProvider
should probably useAddressTarget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to be able to define a complete email transaction in one call. You might want to send to two (or more) different addresses, Cc: another, and Bcc: yet another, and also have a ReplyTo: for the message that is different that the From: address. (some hosting services required the From address to match the authentication user name, which might not be the same as the 'sender' of the immediate message). Using an attribute parameter for the email address implies a single target transaction. Slower if the app wants to send to several targets.