Documentation You are here: start » v » 2.0 » emails

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:emails [2019/04/04 00:21] – [Default Templates and Customizations] adamv:2.0:emails [2024/02/08 17:28] (current) – [Foxy's "Email DNS" Functionality] adam
Line 3: Line 3:
 {{ :v:2.0:email_receipt.png?direct&200|An example email receipt sent by FoxyCart using the default HTML Responsive template}} {{ :v:2.0:email_receipt.png?direct&200|An example email receipt sent by FoxyCart using the default HTML Responsive template}}
  
-FoxyCart's email receipts include almost everything in [[.:receipt#what_s_included_on_the_receipt|the web receipt]], as well as any additional text you have configured in your receipt template(s). (You can see an example receipt to the right.) The major difference between the web receipt and the email receipts is that email receipts have specific sections that are only included in certain situations. We recommend you go to your FoxyCart admin, hit the "email" menu item, and review the code there are you follow alongA portion of the [[.:cheat_sheet|cheat sheet]] is included at the bottom of this page with details of the placeholders used.+FoxyCart's email receipts include almost everything in [[.:receipt#what_s_included_on_the_receipt|the web receipt]], as well as any additional text you have configured in your receipt template(s). (You can see an example receipt to the right.) The major difference between the web receipt and the email receipts is that email receipts have specific sections that are only included in certain situations.  
 + 
 +Email receipts for each transaction are sent to the customer by defaultYou can turn this off by going to the [[https://admin.foxycart.com/admin.php?ThisAction=EditTemplate&template=email|email receipt]] settings of the Foxy admin and removing the text from the **receipt email subject** setting. The email receipt will also not be sent to the store in this case. 
 ==== Transaction Email Receipts ==== ==== Transaction Email Receipts ====
 A "transaction email receipt" is what you'd probably consider to be a "normal" receipt. It's the main content section of a typical receipt, and will generally include the cart contents and transaction information (customer name, email, address, shipping info, etc.). A "transaction email receipt" is what you'd probably consider to be a "normal" receipt. It's the main content section of a typical receipt, and will generally include the cart contents and transaction information (customer name, email, address, shipping info, etc.).
Line 29: Line 32:
 If you choose to [[v:2.0:templates|alter the base templates]] in the //email receipt// settings, the big difference is that email formatting is stuck in the 1990s, so you'll want to brush up on HTML email formatting. [[http://www.campaignmonitor.com/|CampaignMonitor]] has //fantastic// templates and [[http://www.campaignmonitor.com/css/|resources for CSS support in HTML emails]] that we highly recommend. If you choose to [[v:2.0:templates|alter the base templates]] in the //email receipt// settings, the big difference is that email formatting is stuck in the 1990s, so you'll want to brush up on HTML email formatting. [[http://www.campaignmonitor.com/|CampaignMonitor]] has //fantastic// templates and [[http://www.campaignmonitor.com/css/|resources for CSS support in HTML emails]] that we highly recommend.
  
-Also, please [[http://requests.foxycart.com/forums/4162-general-requests/suggestions/586107-convert-email-css-to-inline-styles|vote for this feature request]]which will allow more intelligent use of inline CSS for your email receipts. +As the Foxy email receipt templates handle a number of different emails beyond the normal transaction email receipt (including subscription reminders and cancellations), and the default styles are inlined in the HTMLit does make the template a bit more complex to customise. We know that can make them a bit imposing to work with, and are considering options of email editors that could potentially be integrated.
  
 +Here's some general tips for customising the email receipts beyond just language customisations:
 +  * We would recommend copying the HTML template out into a text editor for modification. One with syntax highlighting (and optionally with support for Twig template language) will make the template easier to work with.
 +  * If you're looking to use a completely different template from another service, you'll need to bring in the Twig logic to handle the different email types and outputting the customers information. There's [[#email_receipt_placeholders|also an overview at the bottom of this page]] with all the placeholders available to the email receipt.
 +  * If you need to reference the default HTML template at all, [[https://github.com/FoxyCart/2.0-templates/blob/master/default_templates/responsive.email.twig|that's also available on Github here]].
 ===== Category Specific Email Receipts ===== ===== Category Specific Email Receipts =====
 FoxyCart allows additional emails to be configured //per [[.:categories|category]]//. The first option is to enable an additional customer email, which could be useful if a specific product category required extra information like conference registration information, special shipping or pickup information, or a request for additional information. The second option is for an additional admin email to be sent, which could be useful if sales of certain products need to notify specific departments within an organization. FoxyCart allows additional emails to be configured //per [[.:categories|category]]//. The first option is to enable an additional customer email, which could be useful if a specific product category required extra information like conference registration information, special shipping or pickup information, or a request for additional information. The second option is for an additional admin email to be sent, which could be useful if sales of certain products need to notify specific departments within an organization.
  
-Also, please [[http://requests.foxycart.com/forums/4162-general-requests/suggestions/1808603-category-emails-cart-only-including-products-i|vote for this improvement to category-specific emails]] if you feel that'd help you better use them.+You can add category emails in your categories [[https://admin.foxycart.com/admin.php?ThisAction=ManageProductCategories#fs_category_email|here]].
  
  
Line 53: Line 59:
 ===== How Emails Are Sent (SPF, DKIM, DMARC, etc.) ===== ===== How Emails Are Sent (SPF, DKIM, DMARC, etc.) =====
  
-There are two ways FoxyCart can be configured to send emails on behalf of your store. By defaultwe'll use our own mail servers. This is easy, and we maintain very high sender reputation (so your emails generally will avoid the spam box of your customers)But if you'd like more control, you can **use your own SMTP server**. We'll discuss both options below.+There are ways Foxy can be configured to send emails on your store'behalf
 +  - **Default:** The email's ''From'' address is your store's configured emailbut Foxy's address is the ''Return-Path'' (meaning we get the bounces), and we'll add ''Sender'' header, so some mail clients may show a message that your email receipts are "on behalf of" or "sent via"SPF and DKIM pass, but **//DMARC will fail//**. If you use DMARC on your domain, you'll need to do one of the following. 
 +  - **Email DNS:** This approach requires some DNS records to be added to your domain, and will allow us to avoid the "sender" header mentioned above. SPF and DKIM pass, but **//DMARC may still fail//**, as we're relying on a duplicate ''sender'' header that works but we don't feel comfortable recommending it at this point. 
 +  - **Bring Your Own SMTP:** You can also configure your own SMTP server, and Foxy will simply use thatYou're responsible for SPF, DKIM, and DMARC, but you may have more control and visibility (if you're using something like MailChimp Mandrill, Zoho ZeptoMail, PostmarkApp, etc.). Note that if there's a connection error, Foxy will fall back to the "default" option above. 
 + 
 +More details about these options are below
  
 ==== Using FoxyCart's Mail Servers (Default) ==== ==== Using FoxyCart's Mail Servers (Default) ====
  
-<wrap tip>If you're using an ''@yahoo.com'' address as your store's "from" addressplease go to the bottom of this section, because you're special.</wrap>+By default, FoxyCart sends emails with extremely high deliverability rates, passing both SPF and DKIM standards. Though your configured email address will be in the ''From'' line of the email, we //do use an @foxycart.com address// in the ''Sender'' headerwhich can cause some mail clients (like Outlook and Hotmail) to display an "on behalf of" message when viewing the message details. Google does something similar by adding a "via" heading.
  
-By default, FoxyCart sends emails according to [[http://www.openspf.org/Best_Practices/Webgenerated|OpenSPF best practices]], and also uses both [[wp>DomainKeys|DomainKeys]] and [[wp>DKIM|DKIM]] to ensure mail sent from our systems are verified at the strictest levelBecause of the approach we've taken to SPFthere are no SPF records you need to add to your domain's DNS.+This default option is easyreliable, and requires no additional work from youBut if you don't want the "on behalf of" or "via" text//OR// if you're using DMARC, you must use one of the following options.
  
-That said, this default approach //does use an @foxycart.com address// in the ''Sender'' headerwhich can cause <wrap important>Microsoft mail clients like Outlook and Hotmail to display mail as sent "on behalf of" when viewing the message details</wrap>. This behavior is incorrrectbut Microsoft has done it for years and from all appearances they have no desire to change it. Google also recently started doing something somewhat similar (though more "correct" and in a more intelligent manner) by adding a "via" heading.+Some domains like ''@yahoo.com'' have strict DMARC policies, which prevent us from spoofing their emails. If you set your store email address to these domains (including ''aol.com'', ''gmail.com'', ''googlemail.com'', ''hotmail.com'', ''live.com'', ''outlook.com'', ''verizon.net'', ''yahoo.ca'', ''yahoo.com''), we cannot use your configured email address as the ''From'' addressso we will send from a Foxy address, with your store's email as the ''Reply-To''. This isn't greatso we recommend using an email at your own domain if you can.
  
-So because of all this we strongly suggest going to your "advanced" section in your [[https://admin.foxycart.com/|FoxyCart admin]] and enabling the "enable email DNS" checkbox. This checkbox tells FoxyCart //not// to use the ''Sender'' header, thereby eliminating this behavior from Microsoft mail clients.+==== Foxy'"Email DNS" Functionality ====
  
-However, because the Sender header is important for deliverability (ie. getting the email into the inbox and not the spam folder) when FoxyCart is "spoofingyour store's domainif you enable this behavior you should also add FoxyCart to your domain's SPF record. If you already have an SPF recordsimply add the following to it: +SPF and DKIM both use the ''Return-Path'' address (aka "mail from", "bounce address", "envelope header"to validatewhich is generally invisible to the recipient, which means an email could pass SPF and DKIM but the ''From'' address could be completely differentDMARC fixes this by relying on SPF or DKIM passing with a ''Return-Path'' address that matches the domain of the ''From'' address.
-<code> +
-include:_spf.foxycart.com +
-</code> +
-If you don't already have an SPF record, you'll need to create oneWhile the details of creating an SPF record go beyond what we can provide here, you can generally pretty easily ask your host for help, or Google for records to use. For example: +
-  * [[http://www.google.com/support/a/bin/answer.py?answer=178723|Help from Google Apps]], if you use Google Apps for your mail +
-  * [[https://www.spfwizard.net/|SPFwizard.net]], which may be very useful. Include ''_spf.foxycart.com'' in the "Any domains that may deliver or relay mail for this domain" section.+
  
-In addition to SPF, you'll also need to add a quick ''TXT'' record to ensure the DKIM validation passesThis is a bit easier, as you'll just have to add the following as a ''TXT'' record to any domains that FoxyCart is sending mail fromSo if your store is sending email from ''orders@example.net'', you'add this: +In order for Foxy to send email on your behalf using your domain in the envelope header, you'll need to add a few DNS recordsNote also that in this situation we'll remove the ''Sender'' header, so there will be no "on behalf of" text in any clients. Our mail servers still handle everything for you, but without any Foxy-related email addresses showing anywhere. 
-<code>+ 
 +To enable this, go to your "advanced" section in your [[https://admin.foxycart.com/|FoxyCart admin]] and enable the "enable email DNS" checkboxIt may take a few hours after your DNS is updated for this to be enabled. You can contact support if you'like a status update. 
 + 
 +^ Record Type       ^ Subdomain           ^ Value                                         ^ 
 +| TXT                | ''smtpapi._domainkey''     <code>
 k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB
-</code> +</code>  | 
-to ''smtpapi._domainkey.example.net''. \\ +| TXT               ''@''     | Add ''include:_spf.foxycart.com'' to your existing SPF record      |
-<wrap tip>Replace the ''example.net'' with your domain.</wrap> \\ +
-<wrap important>If you are setting these manually and not using a web-based control panel you may need to wrap them in quotes.</wrap>+
  
-Againit is //very// important that you complete these steps in order to prevent your FoxyCart-generated receipt emails from ending up in your customersspam folders.+If you don't already have an SPF record on your domainyou will need to create one. While the details of creating an SPF record go beyond what we can provide here, you can generally pretty easily ask your web host for help, or Google for records to use. For example: 
 +  * [[http://www.google.com/support/a/bin/answer.py?answer=178723|Help from Google Apps]], if you use Google Apps for your mail 
 +  * [[https://www.spf-record.com/generator|spf-record.com/generator]], which may be very useful. In the second step, expand the "Advanced Settings" section and add ''_spf.foxycart.com'' in the "Delegate to external SPF record (include)" text area. Note the value for your SPF record will be the portion in the text input that they generate, beginning with ''v=spf1''.
  
-=== Yahoo and DMARC === 
-On Monday, April 7th, 2014, Yahoo implemented a ''p=reject'' setting in their [[http://dmarc.org/|DMARC]] setting. To make a long story short, this overrides all of the above SPF and DKIM talk, and completely prevents FoxyCart from using a ''@yahoo.com'' email address in the ''from'' header, ever. As such, if you enter a ''@yahoo.com'' address as your store's ''from'' email, we will replace the ''from'' with something like ''Your Store Name <store+your_store_name@foxycart.com>'', with a ''reply-to'' of your ''@yahoo.com'' email. There's no way around this, unfortunately, but suffice to say, we don't recommend using Yahoo for your email provider. If possible, use your own domain for your store's email. If you can't, Gmail's currently a good option. 
  
 ==== Using Your Own SMTP Server ==== ==== Using Your Own SMTP Server ====
 +
 If you'd like, you can configure FoxyCart to send email using your own SMTP credentials. You can enable it from the "advanced" settings page of your [[https://admin.foxycart.com/|FoxyCart admin]], within the "Email Receipt Settings" section labelled "Use your own smtp server". A few things to note, if you go this route: If you'd like, you can configure FoxyCart to send email using your own SMTP credentials. You can enable it from the "advanced" settings page of your [[https://admin.foxycart.com/|FoxyCart admin]], within the "Email Receipt Settings" section labelled "Use your own smtp server". A few things to note, if you go this route:
  

Site Tools