MvcMailer icon indicating copy to clipboard operation
MvcMailer copied to clipboard

Any suggestions on encapsulating MvcMailer in a Factory class?

Open kahanu opened this issue 10 years ago • 2 comments

I need to send out email blasts to the members of my organization, and there are a variety of different blasts I need to send based on different criteria.

I tried encapsulating MvcMailer inside a derived class in a Factory Pattern but I always got the "HttpContext null" exception. I even tried passing the current context in and it still didn't work.

Do you have any suggestions on how to encapsulate MvcMailer in this type of pattern? Of course I would need it to run asynchronously.

Thanks,

King Wilder

kahanu avatar May 11 '14 04:05 kahanu

The way it's written, it works with sub classing as opposed to encapsulating.

If you want, you can look at the code and may be change it according to your need.

Thank you


Sent from my iPhone Sohan SM

On May 10, 2014, at 10:47 PM, King Wilder [email protected] wrote:

I need to send out email blasts to the members of my organization, and there are a variety of different blasts I need to send based on different criteria.

I tried encapsulating MvcMailer inside a derived class in a Factory Pattern but I always got the "HttpContext null" exception. I even tried passing the current context in and it still didn't work.

Do you have any suggestions on how to encapsulate MvcMailer in this type of pattern? Of course I would need it to run asynchronously.

Thanks,

King Wilder

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/134 .

smsohan avatar May 11 '14 12:05 smsohan

I have looked at your code. I'll see if I can figure something out.

Thanks,

King Wilder

Sent from my Windows Phone


From: SM Sohanmailto:[email protected] Sent: ý5/ý11/ý2014 5:52 AM To: smsohan/MvcMailermailto:[email protected] Cc: King Wildermailto:[email protected] Subject: Re: [MvcMailer] Any suggestions on encapsulating MvcMailer in a Factory class? (#134)

The way it's written, it works with sub classing as opposed to encapsulating.

If you want, you can look at the code and may be change it according to your need.

Thank you


Sent from my iPhone Sohan SM

On May 10, 2014, at 10:47 PM, King Wilder [email protected] wrote:

I need to send out email blasts to the members of my organization, and there are a variety of different blasts I need to send based on different criteria.

I tried encapsulating MvcMailer inside a derived class in a Factory Pattern but I always got the "HttpContext null" exception. I even tried passing the current context in and it still didn't work.

Do you have any suggestions on how to encapsulate MvcMailer in this type of pattern? Of course I would need it to run asynchronously.

Thanks,

King Wilder

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/134 .

— Reply to this email directly or view it on GitHubhttps://github.com/smsohan/MvcMailer/issues/134#issuecomment-42769768.

kahanu avatar May 11 '14 20:05 kahanu