====== Email Receipts ====== ===== What's In an Email Receipt? ===== {{ :v:0.7.0:email_receipt.example.png?direct&200|An example email receipt sent by FoxyCart using the default HTML 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 along. A portion of the [[.:cheat_sheet|cheat sheet]] is included at the bottom of this page with details of the placeholders used. ==== 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 (via the ''^^cart^^'' placeholder) and transaction information (customer name, email, address, shipping info, etc., via the ''^^receipt^^'' placeholder). Important to note is that the ''^^cart^^'' placeholder will include a block of text (customizable in your store's [[.:i18n|language section]]) with subscription-specific links //if// a subscription is present in the cart. By default, these links will allow your customers to update their payment information or cancel their subscriptions straight from the email receipts they're already receiving. If you're doing [[.:products:subscriptions|recurring billing]] through FoxyCart we strongly recommend taking a look at that text, and running a few test orders. The transaction email receipt will include everything that's part of [[.:receipt|the web-based receipt]] that is displayed to the customer after a successful transaction (in their web browser). ==== Subscription Cancellation Confirmation Email Receipts ==== Breaking up is hard to do, so FoxyCart allows for a customizable section to be included if (and only if) the email receipt is for a subscription cancellation. This will help you make it clear to the customer that their subscription has been set to cancel. These are sent only after a subscription has been successfully canceled //[[.:checkout#subscription_cancellation|through the checkout process]]//. These emails will //not// send if a subscription is set to end or set to be inactive via [[.:api|the API]]. ==== "Update Info" Email Receipts ==== When a customer [[.:checkout#update_info_requests|updates their information with the ''updateinfo'' flag]], this section is included in the email receipt. In this case you likely will not want to include the ''^^cart^^'' placeholder, instead opting to describe that their information has been updated, if they have any questions to get in touch with customer service, or etc. ===== Who Gets Email Receipts? ===== **The customer.** If you have a "receipt email subject" configured in your store's "email" section, the customer will receive an email receipt for any transaction run on their account, including every time their account is billed for any recurring billing they have. **The store.** If you have the "BCC store email address" checkbox checked in your store's "email" section, the store email address (as configured in your store settings) will receive a BCC copy of the email address. Note that this is a straight BCC copy, and looks //identical// to the customer's email receipt. If you're testing with an email address that goes to the same place as the store's email, you likely will only see //one// email receipt, since many mail servers would discard the extra copy as a duplicate. **Other addresses.** If you'd like to send receipts to more than one person at your organization, just add additional emails to the "store email(s)" field in the "store settings" page in the admin. Separate emails by commas. You can also see the [[#category_specific_email_receipts|category specific email receipts]] section below for info on sending to other email addresses. ===== Default Templates and Customizations ===== The default HTML email receipt template is visible at the right, but you can fully customize your email receipt much like you'd do with [[.:templates|any other template]] on your store. 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. ===== 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 section 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. ===== When Email Receipts are Sent ===== Email receipts are sent only in the following two situations: - A customer places a //successful// order. - A store administrator manually resends the email receipt from the "transactions" page in the store's admin. ===== Didn't Get an Email Receipt? ===== If you didn't receive an email receipt that you think you should have, please follow the steps below to ensure we've ruled out the common causes before you contact support. - Check your spam folder. Though we have exceedingly high deliverability rates, and only send from clean IP addresses, it can happen. - Reread the [[#who_gets_email_receipts|"Who Gets Email Receipts"]] section above, and double confirm that your customer email receipt isn't going to the same place as your store's BCC copy. - Be sure that the email address actually exists and can accept mail. Quite often when we look into our mail logs we find that a mail server hasn't been set up or that the email address in question doesn't exist. - [[mailto:helpdesk+email@foxycart.com|Contact support]], being sure to include the exact email address that isn't receiving emails. ===== How Emails Are Sent (SPF, DKIM, etc.) ===== 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 level. Because of the approach we've taken to SPF, there are no SPF records you need to add to your domain's DNS. That said, this default approach //does use an @foxycart.com address// in the ''Sender'' header, which can cause Microsoft mail clients like Outlook and Hotmail to display mail as sent "on behalf of" when viewing the message details. It looks like this: {{ https://img.skitch.com/20110922-18hym4h3kb26sqd252sgn5jn87.jpg|Microsoft mail client handling of a Sender header with "on behalf of" }} This behavior is incorrrect, but 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. 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. However, because the Sender header is important for deliverability (ie. getting the email into the inbox and not the spam folder) when FoxyCart is "spoofing" your store's domain, if you enable this behavior you should also add FoxyCart to your domain's SPF record. If you already have an SPF record, simply add the following to it: include:_spf.foxycart.com If you don't already have an SPF record, you'll 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 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 * [[http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx|Microsoft's SPF Wizard]], which is pretty solid. If you do this wizard make sure you include ''_spf.foxycart.com'' in the "Outsourced Domains" section in step 3. In addition to SPF, you'll also need to add a quick ''TXT'' record to ensure the DKIM validation passes. This 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 from. So if your store is sending email from ''orders@example.net'', you'd add this: k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB to ''smtpapi._domainkey.example.net''. \\ Replace the ''example.net'' with your domain. \\ If you are setting these manually and not using a web-based control panel you may need to wrap them in quotes. Again, it is //very// important that you complete these steps in order to prevent your FoxyCart-generated receipt emails from ending up in your customers' spam folders. ===== Email Receipt Placeholders ===== {{section>.:cheat_sheet#email_receipt_placeholders&noheader&noeditbutton&permalink&footer&nodate}}