Open remesq opened 13 years ago
With the MVCMailer source code you can debug your mailer and see if it's hitting anything unusual on its way to finding/using the desired view. Just to double check, I would try doing a pickup directory location and make sure it's alright in terms of HTML, headers, etc.
Sent from my iPhone
S M Sohan Consultant ThoughtWorks Canada Suite 1100, 600 6th Ave SW Calgary, AB T2P 0S5 Cell: +1 403 714 2673
On 2011-07-24, at 3:23 PM, remesq reply@reply.github.com wrote:
Sorry if this issue is not appropriate here. A while back I started using MvcMailer and had great results in my MVC3 project. The e-mails were getting sent AND the body (using _Layout.cshtml and [NameOfMailer].cshtml) were showing up in the sent e-mail.
In the last two months I started checking out OrchardCMS (v 1.2), and, after deciding to use it, started moving my MVC3 project over. This included trying to create a module that utilized MvcMailer.
Now, I got the module in OrchardCMS to send the e-mail, HOWEVER, no body appears in the message of the e-mail. I have spent countless hours trying to figure out why. I attempted getting help on the OrchardCMS forums, but to no avail. Which is why, as a last ditch effort, I turn to you for any guidance. Again, I understand if you are unable to help.
I have tried a bunch of things. I looked at the MvcMailer source and saw how MailerBase.cs was switching the controller temporarily to get the template/views (_Layout.cshtml and [NameOfMailer].cshtml). I continue to get my success page for sending the mail (and see it in my GMail inbox) but the message body is empty, i.e., it's not finding the layout or view. I received no page errors - leading to my confusion and leading me to try everything under the sun to get it to work.
Out of the multitude of variations I tried to get this to work, I stumbled upon using "PopulateHtmlBody" instead of "PopulateBody". This confirmed my suspicion that the e-mail was not receiving the view. This is the error I received using "PopulateHtmlBody":
The view 'QuoteMailMatrimonialUncontested.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view 'QuoteMail' or its master was not found or no view engine supports the searched locations. The following locations were searched:
Source Error:
Line 35: PopulateHtmlBody(mailMessage, "QuoteMail", "_Layout"); Line 36: //PopulateBody(mailMessage, "QuoteMail", resources);
Again, the code I am using works outside of OrchardCMS in my MVC3 project without a problem.
It has something to do with how OrchardCMS treats its views/routing. I created routes in my Route.cs under the module project; I even created a QuoteMail controller in the module project. Nothing works. I thought you might have some insight.
Thanks for any guidance.
Reply to this email directly or view it on GitHub: https://github.com/smsohan/MvcMailer/issues/23
Sorry if this issue is not appropriate here. A while back I started using MvcMailer and had great results in my MVC3 project. The e-mails were getting sent AND the body (using _Layout.cshtml and [NameOfMailer].cshtml) were showing up in the sent e-mail.
In the last two months I started checking out OrchardCMS (v 1.2), and, after deciding to use it, started moving my MVC3 project over. This included trying to create a module that utilized MvcMailer.
Now, I got the module in OrchardCMS to send the e-mail, HOWEVER, no body appears in the message of the e-mail. I have spent countless hours trying to figure out why. I attempted getting help on the OrchardCMS forums, but to no avail. Which is why, as a last ditch effort, I turn to you for any guidance. Again, I understand if you are unable to help.
I have tried a bunch of things. I looked at the MvcMailer source and saw how MailerBase.cs was switching the controller temporarily to get the template/views (_Layout.cshtml and [NameOfMailer].cshtml). I continue to get my success page for sending the mail (and see it in my GMail inbox) but the message body is empty, i.e., it's not finding the layout or view. I received no page errors - leading to my confusion and leading me to try everything under the sun to get it to work.
Out of the multitude of variations I tried to get this to work, I stumbled upon using "PopulateHtmlBody" instead of "PopulateBody". This confirmed my suspicion that the e-mail was not receiving the view. This is the error I received using "PopulateHtmlBody":
The view 'QuoteMail' or its master was not found or no view engine supports the searched locations. The following locations were searched:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view 'QuoteMail' or its master was not found or no view engine supports the searched locations. The following locations were searched:
Source Error:
Line 35: PopulateHtmlBody(mailMessage, "QuoteMail", "_Layout"); Line 36: //PopulateBody(mailMessage, "QuoteMail", resources);
Again, the code I am using works outside of OrchardCMS in my MVC3 project without a problem.
It has something to do with how OrchardCMS treats its views/routing. I created routes in my Route.cs under the module project; I even created a QuoteMail controller in the module project. Nothing works. I thought you might have some insight.
Thanks for any guidance.