Skip to content
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

Inheritance update #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Postal/Email.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Postal
{
/// <summary>
/// An Email object has the name of the MVC view to render and a view data dictionary
/// to store the data to render. It is best used as a dynamic object, just like the
/// to store the data to render. It is best used as a dynamic object, just like the
/// ViewBag property of a Controller. Any dynamic property access is mapped to the
/// view data dictionary.
/// </summary>
Expand Down Expand Up @@ -55,7 +55,10 @@ protected Email()
/// </summary>
public List<Attachment> Attachments { get; set; }

internal ImageEmbedder ImageEmbedder { get; private set; }
/// <summary>
/// The <see cref="ImageEmbedder"/> that generates the <see cref="LinkedResource"/> objects for the email.
/// </summary>
protected internal ImageEmbedder ImageEmbedder { get; private set; }

/// <summary>
/// Adds an attachment to the email.
Expand All @@ -67,15 +70,15 @@ public void Attach(Attachment attachment)
}

/// <summary>
/// Convenience method that sends this email via a default EmailService.
/// Convenience method that sends this email via a default EmailService.
/// </summary>
public void Send()
{
CreateEmailService().Send(this);
}

/// <summary>
/// Convenience method that sends this email asynchronously via a default EmailService.
/// Convenience method that sends this email asynchronously via a default EmailService.
/// </summary>
public Task SendAsync()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Postal/EmailParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public EmailParser(IEmailViewRenderer alternativeViewRenderer)
/// <param name="emailViewOutput">The email view output.</param>
/// <param name="email">The <see cref="Email"/> used to generate the output.</param>
/// <returns>A <see cref="MailMessage"/> containing the email headers and content.</returns>
public MailMessage Parse(string emailViewOutput, Email email)
public virtual MailMessage Parse(string emailViewOutput, Email email)
{
var message = new MailMessage();
InitializeMailMessage(message, emailViewOutput, email);
Expand Down Expand Up @@ -132,7 +132,7 @@ void ProcessHeader(string key, string value, MailMessage message, Email email)
IEnumerable<AlternateView> CreateAlternativeViews(string deliminatedViewNames, Email email)
{
var viewNames = deliminatedViewNames.Split(new[] { ',', ' ', ';' }, StringSplitOptions.RemoveEmptyEntries);
return from viewName in viewNames
return from viewName in viewNames
select CreateAlternativeView(email, viewName);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Postal/EmailViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public EmailViewRenderer(ViewEngineCollection viewEngines)
/// <param name="email">The email to render.</param>
/// <param name="viewName">Optional email view name override. If null then the email's ViewName property is used instead.</param>
/// <returns>The rendered email view output.</returns>
public string Render(Email email, string viewName = null)
public virtual string Render(Email email, string viewName = null)
{
viewName = viewName ?? email.ViewName;
var controllerContext = CreateControllerContext();
Expand Down