Blank Email issue in magento for new order - magento

In my magento website As soon as someone places order , an email is sent to his/her emailid. In the email the subject is correct but there is no body in the message, i mean the message comes blank.
i added new template from Transactional Emails section and associated this template with the Order from configuration->sales emails. but still my subject of the template reaches to mails but not the body. the message body remains empty always.
please help me solve this issue
thanks in advance

Looks like there is some error during rendering the email template. Try to replace your email template body with something simple.

Magento doesn't trigger any error when the template is not returned/processed properly.
The trace is:
Mage/Sales/Model/Order.php - sendNewOrderEmail()
Mage/Core/Model/Email/Template/Mailer.php - send()
Mage/Core/Model/Template.php - send()
Some things to check first - is the email valid for send, see the conditions below:
public function isValidForSend()
{
return !Mage::getStoreConfigFlag('system/smtp/disable')
&& $this->getSenderName()
&& $this->getSenderEmail()
&& $this->getTemplateSubject();
}
Another thing to look for:
If you copy-pasted some of the email content you might have some characters in the email that are not ASCII. This causes a crash when the template is parsed and there is no error logged/displayed.
This can be checked by using the standard Magento email template and if that works and your custom template doesn't.

I found that the cause of the error was the vars:
{{config path='trans_email/ident_support/email'}}
{{config path='general/store_information/phone'}}
If these are deleted/substituted, then the emails are being sent without errors.

Related

Issue with [Url] data annotaiion

Kind of new to data annotations for validation and need some help on a weird issue I am having. This is a Blazor server application but not sure that makes any difference. In my model I have many properties but this is where the issue is:
[Url]
public string WebsiteURL { get; set; }
As you can see I do not have the [Required] attribute set as I just want to validate if there is text in the textbox. It displays the error message as I would expect when a bad URL is entered:
Now, if I clear the textbox, the error still remains:
I want the validation error message to clear if the textbox is cleared after the validation message is displayed. Even if I click my submit button, the message is still there. How can I do this?
Thank you,
Jim
It seems with is an issue with a few of the data annotation validator tags:
https://github.com/dotnet/runtime/issues/53820
It is strange to me because if I want the value to NOT be blank or null then [Required] should be used for this. I understand the [Url] tag checks for correct format, but it should allow or have an option tag to allow blanks/nulls as well.
To get around this, I had to use RegEx validators for Urls and Email addresses.
Thanks all,
Jim

How do i get body of message when using keyword mentions in teams

in automate i have a flow. I am using "When keywords are mentioned". the keyword i entered is "test"
I Selected, the team,channel,etc... all correctly.
when someone types "the test is a success". in that channel. how do i get the full string "the test is a success"?
I have tried a few operations "get Messages", also tried a few dynamic content options and a few triggeroutput variations. all either are blank or provide a long json string with subscription,channelId,teamId,etc. but not the string I am trying to get.
The Get message details action should help you ...
In the body of the response, you'll clearly see the text that was entered to invoke the trigger.
Use Get message details, you will get message detail of that reply message. Then get your text with expression like this:
outputs('Get_message_details')?['body']['body']['plainTextContent']

Pre-filling a hosted MailChimp signup form with an email address shows validation errors

We're trying to pre-fill the email address field of a hosted MailChimp form. Here's the blog post that talks about exactly this matter: https://blog.mailchimp.com/how-to-pre-fill-items-on-your-mailchimp-hosted-form/.
So here's our Newsletter signup form without any validation errors:
https://camping.us2.list-manage.com/subscribe/post?u=761a52bbd46ab21474b3af314&id=5cc638b5e6.
The problem arises when I add an email address to the URL as the value for the first form field, MERGE0, like this (url-encoding the email address, so # becomes %40):
https://camping.us2.list-manage.com/subscribe/post?u=761a52bbd46ab21474b3af314&id=5cc638b5e6&MERGE0=test%40camping.info.
Now, the form correctly copies the email address into the input field with name MERGE0 but it also displays three validation error messages:
Note: the email address field is mandatory.
When I try to pre-fill the user's first or last name fields adding MERGE1=John or MERGE2=Doe to the form's url, all is well - no error happens. It seems to be a problem with mandatory fields.
I'm arguing that this is a problem on MailChimp's side but they refuse to help saying that this is custom code and none of their business.
Can anybody help fix these errors?
It turned out that the problem was caused by a mistake in the URL.
Instead of camping.us2.list-manage.com/subscribe/POST?u=761a52bbd46ab...
it had to be camping.us2.list-manage.com/subscribe?u=761a52bbd46ab...
And the errors were gone!
This really made sense in the end, because posting the form should actually trigger the validation.

Dingo APi error message

I am trying to render my mailable in the browser in order to check the content. However I'm getting this message {"message":"sha1() expects parameter 1 to be string, object given","status_code":500}
My code snippet
I am running Dingo/Api on my page as well an I think it's somehow connected with it.
Can you please give me the suggestion why am I getting this message instead of rendering mailable?
Thank you
We got this to work by assigning the mailable to a var first and then directly calling the render function on it, like so:
$mailable = new YourMailableName();
return $mailable->render();

Freemarker error message 'For "%" left-hand operand'

Having issues getting an email sent out that had previously worked for a year sending through ClickDimensions, but now only showing an error message in sent email events when using this URL (it sends fine without this url, only has issues with it when in the html):
${Recipient.contact.cd_marketingsummaryinformation.cd_marketingsummaryinformation.cd_autologinurl[0]!''}&returnURL=www.website.com
Full error message (Render Error):
For "%" left-hand operand: Expected a number, but this has evaluated to a node+sequence+hash+string (com.sun.org.apache.xerces.internal.dom.DeferredElementImpl wrapped into f.e.dom.ElementModel):
==> Recipient.contact.cd_marketingsummaryinformation.cd_marketingsummaryinformation.cd_autologinurl[0]! [in template "HTML" at line 130, column 378]
Does anyone have experience in reading what the above error message is pointing the issue to? Would it be a CRM schema side or email platform / freemarker mis-interpretation? or something completely different?
Thank you in advance!

Resources