I use magento 2, when submit contact form then issue on mail - email

I use magento 2, when submit contact form then issue on mail, when receive successfully but problem is apostrophe character.
Suppose any Customer write comment like: Can't able to login then in mail
display like: Can &#039 ; t able to login
I use 4-5 latest version all version this common issue,
Please help to resolve if you know

Go to this path "/vendor/magento/module-contact/view/adminhtml/email" and open "submitted_form.html" and replace 19th line code with the below-mentioned code
{{trans "Comment: %comment" comment=$data.comment|raw}}

Adding to the comment of Abhinav Kumar Singh, there's another way for those who are working with copies of the default e-mail templates in admin backend: MARKETING > COMMUNICATIONS > E-MAIL TEMPLATES.
No need to override original Magento files.
After you have imported the Contact-Form Template, you will find the same syntax in the Template Content field. Just add the "|raw" tag there.
{{trans "Comment: %comment" comment=$data.comment|raw}}
or
{{var data.comment|raw}}

Related

Magento and mandrill smtp headers

I am using Mandrill as a SMTP.
It is successfully connected to Magento 2.
My question :
Is it possible to use Mandrill's custom header references through Magento Email Templates.
For example, I have created custom templates in Mandrill that can be called upon by a customized field in the email header.
Usually it can be added the same way as the reply-to field.
I want to use the following functionality below:
https://mandrill.zendesk.com/hc/en-us/articles/205582117-How-to-Use-SMTP-Headers-to-Customize-Your-M...
Can I add in the header template :
<?php
$headers = $this->getHeaders();
$headers->addTextHeader('X-MC-Template', 'template_name');
?>
Any guidance would be greatly appreciated.
Thanks
You can create your own plugin for Magento (as it was done in the mageplaza/magento-2-smtp extension, they have shared their experience here) that will help you to rewrite the send mail function sendMessage () through the aroundSendMessage () function. In this case you can write headers on your own depend on the message.
How to create a plugin for Magento 2 you can find at Magento official documentation: https://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html

Order confirm email translation issue Magento 2

Our Magento 2.1.5 site is ready to translate all email templates.
But, when a customer creates order, he got non-translated order confirm email immediately. To check this issue, when we click "send email" tab on order view page on admin, we get the correctly translated email.
Send order
What was wrong?
We found this email template which was just order_new.html on theme folder.
app\design\frontend\[vendor]\[theme]\Magento_Sales\email\order_new.html
Also, this template was assigned on vendor.
vendor\magento\module-sales\etc\email_templates.xml
<template id="sales_email_order_template" label="New Order" file="order_new.html" type="html" module="Magento_Sales" area="frontend"/>
Is there any solution?
I solved this issue successfully.
This is solution.
Original:
#subject Your {{var store.getFrontendName()}} order confirmation #
My Solution:
#subject {{trans "Your %store_name order confirmation" store_name=$store.getFrontendName() }}#

Custom tags in Jira email handler

Is there a way to make a Jire email handler ignore the From field in an email and go for a custom tag instead? I know I could work with the API instead but that's in the pipe. this is a temporary solution that will be used until a more robust system is built.
To clarify what we have today:
Email is sent to inbox, (hr#company.com)
Jira picks is up and creates an issue.
Jira looks at the From field and creates a uses if none exist.
What we're trying to achieve:
Form is filled out, and an area is chosen (hr, facilities etc.).
Form is posted to an API that creates an email (basically a no-reply adress over SMTP) and sends it to the appropriate inbox (for example hr#company.com).
Email lands in the inbox and Jira looks in it and creates an issue in project or label 'HR'.
Jira now looks in the email and finds custom tags named [user] and [user-email] (or something) and creates a user from the tag.
Example email
From: no-reply#company.com
To: hr#company.com
Subject: Some problem
Body: Explanation of problem
Have a good day!
/Mike
[user:"Michael Smith"]
[userEmail:"michael.smith#company.com"]
If we were to implement this system now, we would loose the possibility to create new users because all emails would come from the same "no-reply" adress.
I have searched in the Atlassian forums and such, but with no luck. Have not found anything in the official documentation, but I fear that I might be looking in the wrong place.
I hope that I'm being clear, and that someone has any idea if it is possible.
Thank you!
You need to write your own plugin and create your own Mailhandler.
For example you can use a regex which looks for the tag
[userEmail:"michael.smith#company.com"] and retrieve the emailadress from the string. Do the same for the [user]-tag, if the user doesn't exist.
Here is a tutorial that shows how to create and setup custom Message Handlers:
https://developer.atlassian.com/jiradev/jira-platform/guides/email/tutorial-custom-message-mail-handler-for-jira#Tutorial-Custommessage(mail)handlerforJIRA-Step7:Implementarealmessagehandlerback-end
The rest should be easy from here.

How to cloak an email address in a custom html module in joomla 3.1?

is there a way to cloak an email address in a joomla (3.1) custom html module?
Simply entering the email address does neither hide it in the output, nor is the email address click-able.
If you enable the "Prepare Content" parameter in your module and the "Content - Email Cloaking" plugin, this should cloak your e-mail address. Note that enabling this parameter in the module will parse it through all content plugins, which depending on which plugins you have installed, may cause unexpected results.
If email is part of a content, use steps that Michael described.
When it's a separate entity (like parameter user fills in module configuration), use Email: <?php echo JHtml::_('email.cloak', 'foo#bar.com', true) ?>
See Joomla documentation: How to cloak email addresses.
Note: doesn't work on when output document is application/xhtml+xml, but that's a rare case.

Send a copy to yourself with Contact Form 7 in WordPress

I need to add a checkbox with text "Send a copy of this email to yourself" to Contact Form 7 in WordPress, so the sender can receive a copy of the message he sents.
I can't find anything on google, so your help would be really appreciated.
Thank you.
In the solutions above you can have two recipients, but you asked about a mail copy, so a carbon copy perhaps. The best practice is to use the "additional headers" functionality of the "contact form 7" wp plugin.
Good luck! :)
P.S.: But with checkbox it is more complicated, you need to use JS validation in "Form" box.
I am not using Contact Form 7 anymore but as far as I remember on the settings page of your form, there are two areas called Mail. The first one is for receipment and you can enable the other one by checking the checkbox Mail(2). That one is for copies.
http://s.wordpress.org/extend/plugins/contact-form-7/screenshot-1.png?r=561651
By the way, I recommend using: http://www.gravityforms.com/
Very easy to use and lots of options to play with.
add this code to your theme's functions.php
add_filter( 'wpcf7_additional_mail', 'my_wpcf7_use_mail_2_or_not', 10, 2 );
function my_wpcf7_use_mail_2_or_not( $additional_mail, $cf ) {
if ( 'yes' != $cf->posted_data['sendcopy'] )
$additional_mail = array();
return $additional_mail;
}
and alter the select tag to this:
[select sendcopy "no" "yes"]
Copy email form the one with mail tags that you receive and place it to the mail(2) field. and
ticke the Mail(2). then your Mail(2) will be active only when they select "yes".
In the mailing address input field you can just add additional email addresses separated by a comma.
+1 for Gravity Forms too. It's developer licence is well worth the money a brilliant plugin.