Repository: sendgrid/docs Branch: develop Commit: c3eb3fef6132 Files: 627 Total size: 40.7 MB Directory structure: gitextract_6lgdzn0_/ ├── .browserslistrc ├── .eslintignore ├── .eslintrc.json ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE │ └── PULL_REQUEST_TEMPLATE ├── .gitignore ├── .nvmrc ├── .prettierrc ├── .stylelintrc ├── .travis.yml ├── .vscode/ │ └── settings.json ├── CODE_OF_CONDUCT.md ├── README.md ├── content/ │ └── docs/ │ ├── examples.md │ ├── for-developers/ │ │ ├── parsing-email/ │ │ │ ├── inbound-email.md │ │ │ └── setting-up-the-inbound-parse-webhook.md │ │ ├── partners/ │ │ │ ├── account-migration.md │ │ │ ├── amazon-marketplace.md │ │ │ ├── azure.md │ │ │ ├── google.md │ │ │ ├── jelastic.md │ │ │ ├── microsoft-azure-2021.md │ │ │ └── microsoft-azure.md │ │ ├── sending-email/ │ │ │ ├── api-getting-started.md │ │ │ ├── applemail.md │ │ │ ├── authentication.md │ │ │ ├── automating-subusers.md │ │ │ ├── brite-verify.md │ │ │ ├── building-an-x-smtpapi-header.md │ │ │ ├── cakephp.md │ │ │ ├── categories.md │ │ │ ├── cloud-rail.md │ │ │ ├── codeigniter.md │ │ │ ├── cors.md │ │ │ ├── curl-examples.md │ │ │ ├── django.md │ │ │ ├── drupal.md │ │ │ ├── enforced-tls.md │ │ │ ├── exchange-2010.md │ │ │ ├── exim.md │ │ │ ├── formio.md │ │ │ ├── getting-started-email-activity-api.md │ │ │ ├── getting-started-smtp.md │ │ │ ├── getting-started-with-transactional-emails.md │ │ │ ├── how-to-create-a-subuser-with-the-api.md │ │ │ ├── how-to-use-a-transactional-template-with-smtp-or-v2.md │ │ │ ├── iis75.md │ │ │ ├── integrating-with-the-smtp-api.md │ │ │ ├── interspire.md │ │ │ ├── joomla.md │ │ │ ├── laravel.md │ │ │ ├── libraries.md │ │ │ ├── mailpoet.md │ │ │ ├── migrating-from-v2-to-v3-mail-send.md │ │ │ ├── modx.md │ │ │ ├── outlook-2013.md │ │ │ ├── outlook.md │ │ │ ├── personalizations.md │ │ │ ├── phpbb.md │ │ │ ├── piesync.md │ │ │ ├── postfix.md │ │ │ ├── qmail.md │ │ │ ├── quickstart-go.md │ │ │ ├── quickstart-nodejs.md │ │ │ ├── quickstart-php.md │ │ │ ├── quickstart-python.md │ │ │ ├── quickstart-ruby.md │ │ │ ├── rubyonrails.md │ │ │ ├── sandbox-mode.md │ │ │ ├── scheduling-email.md │ │ │ ├── scheduling-parameters.md │ │ │ ├── section-tags.md │ │ │ ├── segmentation-query-language.md │ │ │ ├── send-mime-messages-with-sendgrid.md │ │ │ ├── sender-identity.md │ │ │ ├── sendmail.md │ │ │ ├── single-sends-2020-update.md │ │ │ ├── smtp-errors-and-troubleshooting.md │ │ │ ├── smtp-filters.md │ │ │ ├── smtp-go-code-example.md │ │ │ ├── smtp-nodejs-code-example.md │ │ │ ├── smtp-perl-code-example.md │ │ │ ├── smtp-php-code-example.md │ │ │ ├── smtp-python-code-example.md │ │ │ ├── smtp-ruby-code-example.md │ │ │ ├── ssmtp.md │ │ │ ├── stopping-a-scheduled-send.md │ │ │ ├── stopping-an-in-progress-send.md │ │ │ ├── substitution-tags.md │ │ │ ├── sugarcrm.md │ │ │ ├── suppressions.md │ │ │ ├── symfony.md │ │ │ ├── thunderbird.md │ │ │ ├── unique-arguments.md │ │ │ ├── upgrade-your-authentication-method-to-api-keys.md │ │ │ ├── using-handlebars.md │ │ │ ├── v2-csharp-code-example.md │ │ │ ├── v2-go-code-example.md │ │ │ ├── v2-java-code-example.md │ │ │ ├── v2-nodejs-code-example.md │ │ │ ├── v2-perl-code-example.md │ │ │ ├── v2-php-code-example.md │ │ │ ├── v2-python-code-example.md │ │ │ ├── v2-ruby-code-example.md │ │ │ ├── v3-csharp-code-example.md │ │ │ ├── v3-go-code-example.md │ │ │ ├── v3-java-code-example.md │ │ │ ├── v3-kotlin-code-example.md │ │ │ ├── v3-mail-send-faq.md │ │ │ ├── v3-php-code-example.md │ │ │ ├── v3-python-code-example.md │ │ │ ├── v3-ruby-code-example.md │ │ │ ├── wordpress-faq.md │ │ │ ├── wordpress-plugin.md │ │ │ ├── wordpress-subscription-widget.md │ │ │ ├── zapier-sending-for-gravity-forms-submissions.md │ │ │ ├── zapier-sending-for-new-webhook-data.md │ │ │ ├── zapier-sending-for-postgre-sql-row-matches.md │ │ │ ├── zapier-sending-from-google-sheet-rows.md │ │ │ ├── zapier-sending-to-tagged-infusionsoft-contacts.md │ │ │ ├── zapier-sending-when-new-firebase-child-records-added.md │ │ │ └── zend.md │ │ └── tracking-events/ │ │ ├── analytics-with-keen-io.md │ │ ├── csharp-code-example.md │ │ ├── event-kit.md │ │ ├── event.md │ │ ├── getting-started-event-webhook-security-features.md │ │ ├── getting-started-event-webhook.md │ │ ├── go-code-example.md │ │ ├── google-amp-for-email.md │ │ ├── nodejs-code-example.md │ │ ├── php-code-example.md │ │ ├── python-code-example.md │ │ ├── segment-sendgrid-source.md │ │ └── troubleshooting.md │ ├── glossary/ │ │ ├── 7-bit-encoding.md │ │ ├── a-record.md │ │ ├── account-reputation-dashboard.md │ │ ├── ad-exchange.md │ │ ├── ad-impression.md │ │ ├── ad-unit.md │ │ ├── affiliate-marketing.md │ │ ├── allow-list.md │ │ ├── automated-email.md │ │ ├── autoresponder.md │ │ ├── bayesian-filter.md │ │ ├── blocks.md │ │ ├── bounces.md │ │ ├── bulk-email-service.md │ │ ├── bulk-mail-folder.md │ │ ├── campaigns.md │ │ ├── can-spam.md │ │ ├── categories.md │ │ ├── challenge-response.md │ │ ├── clicks.md │ │ ├── cname.md │ │ ├── complaint.md │ │ ├── ctr.md │ │ ├── custom-fields.md │ │ ├── deferrals.md │ │ ├── deliverability.md │ │ ├── deliveries.md │ │ ├── demand-side-platform.md │ │ ├── deny-list.md │ │ ├── direct-response-advertising.md │ │ ├── dkim.md │ │ ├── dmarc.md │ │ ├── dns.md │ │ ├── domain-authentication.md │ │ ├── domain.md │ │ ├── drip-campaign.md │ │ ├── drops.md │ │ ├── email-api-integration.md │ │ ├── email-authentication.md │ │ ├── email-harvesting.md │ │ ├── email-marketing.md │ │ ├── email-service-provider.md │ │ ├── event-webhook.md │ │ ├── expandable-banner.md │ │ ├── expired.md │ │ ├── feedback-loop.md │ │ ├── flighting-in-advertising.md │ │ ├── fqdn.md │ │ ├── frequency-capping.md │ │ ├── gdpr.md │ │ ├── header.md │ │ ├── imap.md │ │ ├── invalid-email.md │ │ ├── ip-address.md │ │ ├── ip-warmup.md │ │ ├── link-branding.md │ │ ├── lists.md │ │ ├── mail-merge.md │ │ ├── mailbox-provider.md │ │ ├── message-id.md │ │ ├── mta.md │ │ ├── mx-record.md │ │ ├── native-advertising.md │ │ ├── open-rate.md │ │ ├── openrelay.md │ │ ├── opens.md │ │ ├── peer-invitations.md │ │ ├── phishing.md │ │ ├── preheader.md │ │ ├── programmatic-media-buying.md │ │ ├── rate-limiting.md │ │ ├── reconfirmation.md │ │ ├── request.md │ │ ├── reseller-email-account.md │ │ ├── reserved-fields.md │ │ ├── reverse-dns.md │ │ ├── scheduled-emails.md │ │ ├── segmentation.md │ │ ├── segments.md │ │ ├── sender-authentication.md │ │ ├── sender-id.md │ │ ├── senders.md │ │ ├── sends.md │ │ ├── single-send.md │ │ ├── smtp-api.md │ │ ├── smtp-provider.md │ │ ├── smtp-relay.md │ │ ├── smtp-server.md │ │ ├── smtp-service.md │ │ ├── smtp.md │ │ ├── spam-filter.md │ │ ├── spam-reports.md │ │ ├── spam-traps.md │ │ ├── spam.md │ │ ├── spf.md │ │ ├── spoofing.md │ │ ├── subscriber-list-management.md │ │ ├── suspicious-sender.md │ │ ├── system-fields.md │ │ ├── teammates.md │ │ ├── throttling.md │ │ ├── timezone.md │ │ ├── tls.md │ │ ├── transactional-email-templates.md │ │ ├── transactional-email.md │ │ ├── triggered-actions.md │ │ ├── triggered-email.md │ │ ├── trusted-sender.md │ │ ├── two-factor-authentication.md │ │ ├── undelivered-email.md │ │ ├── unknown-user.md │ │ ├── utm-parameters.md │ │ ├── web-api.md │ │ ├── whitelabel.md │ │ └── x-message-id.md │ ├── release-notes/ │ │ ├── 2017-07-07.md │ │ ├── 2017-08-01.md │ │ ├── 2017-09-05.md │ │ ├── 2017-09-14.md │ │ ├── 2017-10-02.md │ │ ├── 2017-10-11.md │ │ ├── 2017-11-01.md │ │ ├── 2017-12-20.md │ │ ├── 2018-01-04.md │ │ ├── 2018-02-13.md │ │ ├── 2018-02-16.md │ │ ├── 2018-02-27.md │ │ ├── 2018-03-01.md │ │ ├── 2018-03-06.md │ │ ├── 2018-03-08.md │ │ ├── 2018-03-14.md │ │ ├── 2018-03-16.md │ │ ├── 2018-03-29.md │ │ ├── 2018-04-09.md │ │ ├── 2018-04-10.md │ │ ├── 2018-04-11.md │ │ ├── 2018-04-17.md │ │ ├── 2018-05-01.md │ │ ├── 2018-05-15.md │ │ ├── 2018-06-06.md │ │ ├── 2018-07-23.md │ │ ├── 2018-08-08.md │ │ ├── 2018-08-22.md │ │ ├── 2018-09-26.md │ │ ├── 2018-10-15.md │ │ ├── 2018-11-05.md │ │ ├── 2018-11-09.md │ │ ├── 2018-11-14.md │ │ ├── 2018-12-01.md │ │ ├── 2018-12-17.md │ │ ├── 2019-01-17.md │ │ ├── 2019-02-25.md │ │ ├── 2019-04-01.md │ │ ├── 2019-04-02.md │ │ ├── 2019-04-03.md │ │ ├── 2019-04-17.md │ │ ├── 2019-04-22.md │ │ ├── 2019-05-09.md │ │ ├── 2019-06-04.md │ │ ├── 2019-07-02.md │ │ ├── 2019-07-10.md │ │ ├── 2019-07-16.md │ │ ├── 2019-07-31.md │ │ ├── 2019-08-06.md │ │ ├── 2019-08-26.md │ │ ├── 2019-08-27.md │ │ ├── 2019-09-04.md │ │ ├── 2019-09-05.md │ │ ├── 2019-09-10.md │ │ ├── 2019-09-19.md │ │ ├── 2019-09-23.md │ │ ├── 2019-09-25.md │ │ ├── 2019-09-27.md │ │ ├── 2019-10-01.md │ │ ├── 2019-10-09.md │ │ ├── 2019-10-10.md │ │ ├── 2019-10-23.md │ │ ├── 2019-19-12.md │ │ ├── 2020-01-01.md │ │ ├── 2020-01-13.md │ │ ├── 2020-01-29.md │ │ ├── 2020-02-10.md │ │ ├── 2020-03-19.md │ │ ├── 2020-04-07.md │ │ ├── 2020-04-13.md │ │ ├── 2020-04-21.md │ │ ├── 2020-04-30.md │ │ ├── 2020-05-06.md │ │ ├── 2020-05-18.md │ │ ├── 2020-07-13.md │ │ ├── 2020-07-21.md │ │ ├── 2020-08-13.md │ │ ├── 2020-08-17.md │ │ ├── 2020-08-19.md │ │ ├── 2020-09-03.md │ │ ├── 2020-09-16.md │ │ ├── 2020-09-17.md │ │ ├── 2020-09-29.md │ │ ├── 2020-11-11.md │ │ ├── 2020-11-18.md │ │ ├── 2020-12-01.md │ │ ├── 2020-12-03.md │ │ ├── 2020-12-09.md │ │ ├── 2020-12-10.md │ │ ├── 2020-12-16.md │ │ ├── 2020-12-17.md │ │ ├── 2021-01-07.md │ │ ├── 2021-01-12.md │ │ ├── 2021-01-13.md │ │ ├── 2021-01-19.md │ │ ├── 2021-02-17.md │ │ ├── 2021-03-15.md │ │ ├── 2021-03-24.md │ │ ├── 2021-03-30.md │ │ ├── 2021-04-13.md │ │ ├── 2021-05-19.md │ │ ├── 2021-05-25.md │ │ └── 2021-06-02.md │ └── ui/ │ ├── account-and-settings/ │ │ ├── accessing-email-account-associated-with-sendgrid.md │ │ ├── account-compromised.md │ │ ├── account-under-review.md │ │ ├── account.md │ │ ├── alerts.md │ │ ├── api-keys.md │ │ ├── billing.md │ │ ├── cancel-your-account.md │ │ ├── configuring-sign-in-with-apple.md │ │ ├── custom-ssl-configurations.md │ │ ├── dedicated-ip-addresses.md │ │ ├── dkim-records.md │ │ ├── dns-providers.md │ │ ├── forced-password-reset-faq.md │ │ ├── heroku-credentials.md │ │ ├── hipaa-compliant.md │ │ ├── how-to-set-up-domain-authentication.md │ │ ├── how-to-set-up-link-branding.md │ │ ├── how-to-set-up-reverse-dns.md │ │ ├── inbound-parse.md │ │ ├── ip-access-management.md │ │ ├── ip-pools.md │ │ ├── log-in-issues.md │ │ ├── mail.md │ │ ├── notifications.md │ │ ├── partners.md │ │ ├── password-reset-appdirect.md │ │ ├── password-reset-azure.md │ │ ├── password-reset-email.md │ │ ├── password-reset-ibm-cloud-marketplace.md │ │ ├── password-reset-openshift.md │ │ ├── password-reset-softlayer.md │ │ ├── pci-compliant.md │ │ ├── reading-your-invoice.md │ │ ├── resetting-your-username-and-password.md │ │ ├── retired-mail-settings.md │ │ ├── reverse-dns.md │ │ ├── safely-test-your-sending-speed.md │ │ ├── spf-dkim.md │ │ ├── spf-limitations.md │ │ ├── spf-records.md │ │ ├── sso-okta.md │ │ ├── sso.md │ │ ├── subusers.md │ │ ├── support.md │ │ ├── taxes-and-tax-exempt.md │ │ ├── teammates.md │ │ ├── tracking.md │ │ ├── troubleshooting-delays-and-latency.md │ │ ├── troubleshooting-sender-authentication.md │ │ ├── two-factor-authentication.md │ │ ├── upgrading-your-account.md │ │ └── verifying-your-account.md │ ├── analytics-and-reporting/ │ │ ├── browser-comparison.md │ │ ├── browser.md │ │ ├── categories.md │ │ ├── category-comparison.md │ │ ├── click-tracking-html-best-practices.md │ │ ├── click-tracking-ssl.md │ │ ├── device.md │ │ ├── email-activity-feed.md │ │ ├── email-activity.md │ │ ├── geographic.md │ │ ├── global.md │ │ ├── google-analytics.md │ │ ├── interpreting-expert-insights.md │ │ ├── mailbox-provider-comparison.md │ │ ├── marketing-campaigns-stats-overview.md │ │ ├── marketing-campaigns-stats.md │ │ ├── migrating-from-the-new-relic-plugin.md │ │ ├── spam-reports.md │ │ ├── stats-overview.md │ │ ├── subscribing-to-expert-insights.md │ │ ├── subuser-comparison.md │ │ ├── subuser.md │ │ ├── tracking-data-with-keen-io.md │ │ └── tracking-stats-using-new-relic.md │ ├── managing-contacts/ │ │ ├── building-your-contact-list.md │ │ ├── create-and-manage-contacts.md │ │ ├── custom-fields.md │ │ ├── email-address-validation.md │ │ ├── formatting-a-csv.md │ │ └── segmenting-your-contacts.md │ └── sending-email/ │ ├── a-b-testing.md │ ├── adding-dynamic-content-with-handlebars-in-marketing-campaigns.md │ ├── attachments-with-digioh.md │ ├── blocks.md │ ├── bounces.md │ ├── checking-email-source.md │ ├── coming-soon-to-new-marketing-campaigns.md │ ├── content-delivery-networks.md │ ├── create-and-edit-legacy-transactional-templates.md │ ├── create-and-manage-unsubscribe-groups.md │ ├── cross-platform-html-design.md │ ├── deliverability.md │ ├── deny-lists.md │ ├── dmarc.md │ ├── editor.md │ ├── email-flow.md │ ├── email-testing.md │ ├── email-to-sms.md │ ├── formatting-html.md │ ├── getting-started-with-automation.md │ ├── global-unsubscribes.md │ ├── google-feedback-loop.md │ ├── group-unsubscribes.md │ ├── how-to-implement-dmarc.md │ ├── how-to-send-an-email-with-dynamic-transactional-templates.md │ ├── how-to-send-email-with-marketing-campaigns.md │ ├── image-editor.md │ ├── index-suppressions.md │ ├── invalid-emails.md │ ├── ip-warmup-for-the-new-marketing-campaigns-experience.md │ ├── legacy-newsletter-sunset.md │ ├── list-unsubscribe.md │ ├── migrating-from-legacy-marketing-campaigns.md │ ├── migrating-from-legacy-templates.md │ ├── old-editor-sunset.md │ ├── recipient-subscription-preferences.md │ ├── sender-verification.md │ ├── senders.md │ ├── single-sends.md │ ├── spam-traps.md │ ├── spam.md │ ├── ssl-vs-tls.md │ ├── subscription-tracking.md │ ├── substitution-and-section-tags.md │ ├── tls.md │ ├── universal-links.md │ ├── unsubscribe-groups.md │ ├── warming-up-an-ip-address.md │ ├── weblink.md │ └── working-with-marketing-campaigns-email-designs.md ├── data/ │ └── SiteConfig.js ├── first-timers-tr.md ├── first-timers.md ├── gatsby-browser.js ├── gatsby-config.js ├── gatsby-node.js ├── jsconfig.json ├── license ├── package.json ├── plugins/ │ ├── sendgrid-remark-code-in-html/ │ │ ├── index.js │ │ └── package.json │ ├── sendgrid-remark-headers/ │ │ ├── index.js │ │ └── package.json │ ├── sendgrid-remark-paths/ │ │ ├── index.js │ │ └── package.json │ └── sendgrid-remark-tables/ │ ├── index.js │ └── package.json ├── redirects.js ├── src/ │ ├── components/ │ │ ├── About/ │ │ │ ├── About.scss │ │ │ └── index.jsx │ │ ├── AsideMenu/ │ │ │ └── index.jsx │ │ ├── BreadCrumbs/ │ │ │ └── index.jsx │ │ ├── Footer/ │ │ │ ├── Footer.scss │ │ │ └── index.jsx │ │ ├── FooterCallout/ │ │ │ ├── FooterCallout.scss │ │ │ └── index.jsx │ │ ├── GlossaryPartial/ │ │ │ ├── GlossaryPartial.scss │ │ │ └── glossaryPartial.jsx │ │ ├── Group/ │ │ │ └── index.jsx │ │ ├── Libaries/ │ │ │ ├── index.jsx │ │ │ └── libaries.scss │ │ ├── NavMain/ │ │ │ ├── NavMain.scss │ │ │ └── index.jsx │ │ ├── NavSub/ │ │ │ ├── NavSub.scss │ │ │ └── index.jsx │ │ ├── Rating/ │ │ │ ├── Rating.scss │ │ │ └── index.js │ │ ├── ReleaseNotes/ │ │ │ ├── ReleaseKey.jsx │ │ │ └── ReleaseNotePost.jsx │ │ ├── SEO/ │ │ │ └── index.jsx │ │ ├── Search/ │ │ │ ├── index.jsx │ │ │ └── search.scss │ │ ├── SocialLinks/ │ │ │ ├── SocialLinks.css │ │ │ └── index.jsx │ │ ├── StatusPage/ │ │ │ ├── index.jsx │ │ │ └── statusPage.scss │ │ ├── layout/ │ │ │ ├── NoHeaderFooter.jsx │ │ │ └── index.jsx │ │ └── withUser/ │ │ └── index.jsx │ ├── componentsMarkdown/ │ │ ├── Callout.jsx │ │ ├── CalloutLink.jsx │ │ ├── CodeGroup.jsx │ │ ├── Gist.jsx │ │ └── PageAnchor.jsx │ ├── constants/ │ │ ├── categories.js │ │ ├── footerLinks.js │ │ ├── forDevelopersCards.js │ │ ├── glossaryTerms.js │ │ ├── groups.js │ │ ├── homeCallouts.js │ │ ├── homeCards.js │ │ ├── libraries.js │ │ ├── pageLinks.js │ │ ├── socialLinks.js │ │ └── starWars.js │ ├── html.jsx │ ├── pages/ │ │ ├── 404.jsx │ │ ├── 404.scss │ │ ├── api-reference.jsx │ │ ├── api-reference.scss │ │ ├── for-developers.jsx │ │ ├── for-developers.scss │ │ ├── glossary.jsx │ │ ├── glossary.scss │ │ ├── index.jsx │ │ ├── index.scss │ │ ├── release-notes.jsx │ │ ├── release-notes.scss │ │ └── site-map.jsx │ ├── scss/ │ │ ├── components/ │ │ │ ├── _accordions.scss │ │ │ ├── _alerts.scss │ │ │ ├── _algolia.scss │ │ │ ├── _badges.scss │ │ │ ├── _breadcrumbs.scss │ │ │ ├── _buttons.scss │ │ │ ├── _cards.scss │ │ │ ├── _center-modals.scss │ │ │ ├── _checkboxes-radios.scss │ │ │ ├── _confirmation-alerts.scss │ │ │ ├── _date-range.scss │ │ │ ├── _dropdowns.scss │ │ │ ├── _dropzones.scss │ │ │ ├── _email-cards.scss │ │ │ ├── _filters.scss │ │ │ ├── _horizontal-rules.scss │ │ │ ├── _loader.scss │ │ │ ├── _meters.scss │ │ │ ├── _modals.scss │ │ │ ├── _numbered-steps.scss │ │ │ ├── _pagination.scss │ │ │ ├── _progress-stages.scss │ │ │ ├── _ranges.scss │ │ │ ├── _segment-terms.scss │ │ │ ├── _selects.scss │ │ │ ├── _switches.scss │ │ │ ├── _tables.scss │ │ │ ├── _tabs.scss │ │ │ ├── _text-inputs.scss │ │ │ ├── _textareas.scss │ │ │ └── _tooltips.scss │ │ ├── global/ │ │ │ ├── _grid.scss │ │ │ ├── _main.scss │ │ │ ├── _mixins.scss │ │ │ ├── _reset.scss │ │ │ ├── _typography.scss │ │ │ ├── _utilities.scss │ │ │ └── _variables.scss │ │ └── style-guide.scss │ └── templates/ │ ├── category.jsx │ ├── category.scss │ ├── doc.jsx │ ├── doc.scss │ └── syntax-highlighting.scss ├── static/ │ ├── assets/ │ │ ├── TwilioSendGrid_Sample_Dashboard_NoSubusers.json │ │ ├── TwilioSendGrid_Sample_Dashboard_WithSubusers.json │ │ ├── example.csv │ │ ├── global-ca466351408fcb1dae4bdec742db56d2.js │ │ └── global-ecc286f800632a989058f964b0d52b7a.css │ ├── config.json │ ├── images/ │ │ ├── RT_1.0.html │ │ ├── RT_2.0.html │ │ ├── RT_3.0.html │ │ ├── code.txt │ │ └── sg-devguide002.png.bak │ └── img/ │ └── Scream750.psd ├── styleguide.md └── travis/ ├── after_deploy.sh ├── build.sh ├── deploy.sh └── deploy_open_source.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .browserslistrc ================================================ Last 2 versions ================================================ FILE: .eslintignore ================================================ public static .cache content ================================================ FILE: .eslintrc.json ================================================ { "extends": ["airbnb"], "plugins": ["react", "jsx-a11y", "import"], "rules": { "react/prefer-stateless-function": "off", "react/prop-types": "off", "react/no-danger": "off", "jsx-a11y/no-noninteractive-element-to-interactive-role": "off", "jsx-a11y/anchor-is-valid": [ "error", { "components": [ "Link" ], "specialLink": [ "to" ] } ] }, "settings": { "import/core-modules": [] }, "env": { "browser": true } } ================================================ FILE: .github/CONTRIBUTING.md ================================================ Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies. All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under. * [Content Request](#feature-request) * [Improvements to the Codebase](#improvements-to-the-codebase) * [Local Setup](#install-and-run-locally) * [Dependencies](#dependencies) * [Setup Steps](#setup-steps) * [Configure Jekyll](#configure-jekyll) * [Running](#running) * [View Your Install](#view-your-install) * [Config](#config) * [Pages](#pages) * [SEO](#seo) * [Custom Liquid Tags](#tags) * [Anchors](#anchors) * [Info blocks](#info_blocks) * [API Examples](#api) * [JS and CSS, etc.](#js_and_css) * [Creating a Pull Request](#creating-a-pull-request) Feel free to grab an issue you want to work on. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions, and additional PRs are welcomed and encouraged. **Submit all pull requests to the develop branch.** There are a few ways to contribute, which we'll enumerate below: ## Content Request If you'd like to make a content request, please read this section. The GitHub issue tracker is the preferred channel for docs content requests, but please respect the following restrictions: - Please **search for existing issues** in order to ensure we don't have duplicate bugs/content requests. - Please be respectful and considerate of others when commenting on issues. ## Improvements to the Codebase We welcome direct contributions to the SendGrid docs code base. Thank you! ## Local Setup ### Dependencies * Required: * Git * Rvm * Homebrew * npm * Gatsby ### Setup Steps * Install Git for: * [Mac](https://git-scm.com/download/mac) * [Windows](https://git-scm.com/download/win) * [Linux](https://git-scm.com/download/linux) * Install RVM `$ \curl -sSL https://get.rvm.io | bash -s stable --ruby` * Install Homebrew (if you don't have it) `$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` * Install npm `$ brew install npm` **Note:** You may need to use 'sudo' before the command to get it to work as intended. * Set your Node version `$ npm install -g n` `$ n 8.4.0` * clone repo `$ git clone https://github.com/sendgrid/docs.git` * Go to your docs directory `$ cd docs` * switch to develop branch to make changes `$ git checkout develop` * Install Gatsby `npm ci` * Build the local site `gatsby develop` Gatsby starts a hot-reloading development environment accessible at [localhost:8000](localhost:8000) ## Config The gatsby config is defined in [gatsby-config.js](../gatsby-config.js). The site config is defined in [data/SiteConfig.js](../data/SiteConfig.js) which you usually don't have to modify but are helpful to know about. ### Pages You can write pages in markdown, HTML, or HAML. They all get converted to HTML when the site is generated. Pages have a block of YAML at the top that sets a few options. They are pretty self-explanatory; here's an example ``` --- layout: page weight: 0 title: Docs Home icon: icon-home showTitle: false navigation: show: true --- ``` Weights are same as the folder weights - the higher numbers move higher up the tree. Icons are based on the CSS icon class names from Twitter Bootstrap. showTitle and navigation["show"] both default to true if not specified. #### SEO Various fields pertinent to SEO can be controlled through the YAML front matter. Here's an example: ``` --- seo: title: Really Great Documentation - SendGrid Documentation | SendGrid override: true description: This is some really great documentation! I hope you like it! canonical: https://sendgrid.com/docs/really-great-docs --- ``` By default `` tags follow the template `{Page Title} {Site Title}`. However the page title can be changed for the purpose of the tag by using `seo["title"]`. `seo["override"]` will override the entire template, instead making the title page `{seo["title"]}`. `description` and `canonical` change their respective tags. <a name="tags"></a> ### Custom Liquid Tags There are some custom plugins (look in the `plugins` folder) that define new liquid blocks for use in pages. <a name="anchors"></a> #### Anchors You can create anchor tags that will have named anchors generated for them automatically with links on hover. The parameter is the wrapping element to use. ``` {% anchor h2 %} Some Anchor Text {% endanchor %} ``` <a name="info_blocks"></a> #### Info blocks Similarly you can create info and warning blocks: ``` {% info %} Some info for a breakout block. {% endinfo %} {% warning %} ...And a warning breakout. {% endwarning %} ``` <a name="api"></a> #### API Examples If you are working on API reference docs, you can generate XML and JSON nav tabs and the corresponding example calls and responses like so: ``` {% apiexample identifier GET http://some.endpoint.url var1=stuff&var2=junk %} {% response json %} { "foo": "bar" } {% endresponse %} {% response xml %} <foo>bar</foo> {% endresponse %} {% endapiexample %} ``` The parameters for the `apiexample` block are: unique identifier, HTTP method, the url (excluding .json or .xml extension), and the data payload in querystring format. <a name="js_and_css"></a> ## JS and CSS, etc JavaScript and CSS are minified and combined. The files to be packaged and their orders are specified in `_includes/head.html` and <code>CssMinify.yml</code>. Preprocessing and options can be specified via `_plugins/jekyll_asset_pipeline.rb`. <a name="creating-a-pull-request"></a> ## Creating a Pull Request 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: ```bash # Clone your fork of the repo into the current directory $ git clone https://github.com/sendgrid/docs # Navigate to the newly cloned directory $ cd docs # Assign the original repo to a remote called "upstream" $ git remote add upstream https://github.com/sendgrid/docs ``` 2. If you cloned a while ago, get the latest changes from upstream: ```bash $ git checkout <dev-branch> $ git pull upstream <dev-branch> ``` 3. Create a new topic branch (off the project development branch) to contain your feature, change, or fix: ```bash $ git checkout -b <topic-branch-name> ``` 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely to be merged into the main project. Use Git's [rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public. 4a. Create tests. 4b. Create or update the example code that demonstrates the functionality of this change to the code. 5. Locally merge (or rebase) the upstream development branch into your topic branch: ```bash $ git pull [--rebase] upstream main ``` 6. Push your topic branch up to your fork: ```bash $ git push origin <topic-branch-name> ``` 7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/) with a clear title and description against the `develop` branch. All tests must be passing before we will review the PR. If you have any additional questions, please feel free to [email](mailto:dx@sendgrid.com) us or create an issue in this repo. ================================================ FILE: .github/ISSUE_TEMPLATE ================================================ <!-- Please avoid submitting support questions here. You can contact our support team at https://support.sendgrid.com. If you are able to login to https://support.sendgrid.com: 1. Click "Login & Contact Support." 2. Then, select "Contact Support" to see your contact options. If you are unable to login to https://support.sendgrid.com: 1. Click "Trouble Logging in?" 2. Then, select "I am having a different login issue." If you are reporting an issue with our docs, thanks for letting us know! --> ## Expected content ## Actual content **Link to page**: ================================================ FILE: .github/PULL_REQUEST_TEMPLATE ================================================ ### Checklist **Required** - [x] I acknowledge that all my contributions will be made under the project's license. ### PR Details **Description of the change**: **Reason for the change**: **Link to original source**: <!-- If this pull request closes an issue, add the issue number here: --> Closes # ================================================ FILE: .gitignore ================================================ .vagrant/ .jekyll_indextank/ .rvmrc _config.yml _config.dev.yml _config.deploy.yml .bundle .DS_Store .sass-cache .gist-cache .idea .pygments-cache _deploy sass.old source.old source/_stash source/stylesheets/screen.css vendor node_modules pdf public linklint_logs bower_components source/_assets/bower_components source/.asset_pipeline npm-debug.log .cache ================================================ FILE: .nvmrc ================================================ 12.* ================================================ FILE: .prettierrc ================================================ { "semi": false, "singleQuote": true, "trailingComma": "es5" } ================================================ FILE: .stylelintrc ================================================ { "extends": "stylelint-config-standard", "plugins": [ "stylelint-selector-bem-pattern" ], "rules": { "indentation": 2, "at-rule-no-unknown": null, "plugin/selector-bem-pattern": { "componentName": "(([a-z0-9]+(?!-$)-?)+)", "componentSelectors": { "initial": "\\.{componentName}(((__|--)(([a-z0-9\\[\\]'=]+(?!-$)-?)+))+)?$" }, "ignoreSelectors": [ ".*\\.no-js.*", ".*\\.js-.*", ".*\\.lt-ie.*" ] } } } ================================================ FILE: .travis.yml ================================================ sudo: required dist: focal language: node_js branches: only: - main - develop node_js: - 12.16.* cache: - pip - npm install: - pip install --user awscli before_script: - npm ci script: ./travis/build.sh deploy: - provider: script script: ./travis/deploy.sh skip_cleanup: true on: repo: sendgrid/docs all_branches: true condition: $TRAVIS_BRANCH = develop || $TRAVIS_BRANCH = main - provider: script script: ./travis/deploy_open_source.sh skip_cleanup: true on: repo: sendgrid/docs all_branches: true condition: $TRAVIS_BRANCH = develop after_deploy: ./travis/after_deploy.sh ================================================ FILE: .vscode/settings.json ================================================ { "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "eslint.enable": true, "editor.tabSize": 2, "editor.insertSpaces": true, "eslint.options": { "config": ".eslintrc.json", "configFile": ".eslintrc.json" } } ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # SendGrid Community Code of Conduct The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful, and growing community. ### Be Open Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference. ### Be Considerate Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views. ### Be Respectful Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. ## Additional Guidance ### Disclose Potential Conflicts of Interest Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another. ### Interpretation This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble, and Honest. ### Enforcement Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors. ## If you have concerns about someone’s conduct **Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code. **Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first. **Contact the Moderators** - You can reach the SendGrid moderators by emailing dx@sendgrid.com. ## Submission to SendGrid Repositories Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com). ## Attribution SendGrid thanks the following, on which it draws for content and inspiration: * [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/) * [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct) * [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html) ================================================ FILE: README.md ================================================ ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) **THIS REPOSITORY WILL NO LONGER BE MONITORED AFTER JUNE 15, 2021** # SendGrid Documentation [![Build Status](https://travis-ci.org/sendgrid/docs.svg?branch=develop)](https://travis-ci.org/sendgrid/docs) [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./license) ## Introduction This is a Gatsby site. The develop branch is merged to production weekly (unless we need to do a release sooner than that). The main branch is continuously deployed to production. - **_Please_, feel free to make any contributions you feel will make SendGrid Documentation better.** - **Familiarize yourself with our [Styleguide](styleguide.md)** - **Submit all pull requests to the develop branch** - **All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.** - **When making contributions, be sure to place an "x" in the brackets of the PR description where it says "[ ] I acknowledge that all my contributions will be made under the project's license."** ## Table of Contents - [Local Dependency Setup](#local-dependency-setup) - [Mac](#mac) - [Windows](#windows) - [Linux](#linux) - [Local Repository Setup](#local-repository-setup) - [About](#about) - [License](#license) ## Local Dependency Setup ### Dependencies - Required: - [Git](https://git-scm.com) - [npm](https://www.npmjs.com) - [Gatsby](https://www.gatsbyjs.org) **Note:** Dependencies differ for work on the `old-develop` branch. If you need to work on `old-develop`, please see the README file after checking out that branch. This is uncommon. ## Setup Steps #### Mac - Install Git - [Git for Mac](https://git-scm.com/download/mac) We recommend using [Homebrew](https://brew.sh/) to install and manage packages on a MacOS. - Install Homebrew: ```shell $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` - Install npm: ```shell $ brew install npm ``` - Set your Node.js version to 12 ```shell $ npm install -g n $ n 12.16.1 ``` #### Windows - Install Git - [Git for Windows](https://git-scm.com/download/win) - Install npm - To install Node.js and npm on Windows, you can download the installer here: - https://nodejs.org/en/#home-downloadhead - Use Node.js version 12, the current Long Term Support (LTS) version. #### Linux - Install Git: - [Git for Linux](https://git-scm.com/download/linux) - Install npm: - To install Node.js and npm on Linux, select the package and instillation appropriate for your Linux distribution. You can find help here: - https://nodejs.org/en/download/package-manager/ - Use Node.js version 12, the current Long Term Support (LTS) version. ## Local Repository Setup **Note:** When working on Windows, you may need to run Command Prompt or PowerShell as an Administrator. **Note:** When working on Mac or Linux, you may need to run some commands using "sudo." - Clone the SendGrid Docs Repo - SSH: ```shell $ git clone git@github.com:sendgrid/docs.git ``` - HTTPS: ```shell $ git clone https://github.com/sendgrid/docs.git ``` - Go to your docs directory ```shell $ cd docs ``` - Switch to develop branch to make changes ```shell $ git checkout develop ``` - Install the Gatsby CLI ```shell $ npm install -g gatsby-cli ``` - Install npm package dependencies ```shell $ npm ci ``` - Build the local site - With the Gatsby CLI installed globally, you can run: ```shell $ gatsby develop ``` - Alternatively, you can run: ```shell $ npm run develop ``` - Either of the above commands should start a hot-reloading development environment accessible at [localhost:8000](localhost:8000) ## About SendGrid is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). It is maintained and funded by SendGrid, Inc. The names and logos are trademarks of SendGrid, Inc. ## License SendGrid Documentation is licensed under the **[MIT License (MIT)](https://github.com/sendgrid/docs/blob/develop/license)** ================================================ FILE: content/docs/examples.md ================================================ --- title: Markdown Examples slug: markdown-examples navigation: show: true --- ## Callout Link ```html <call-out-link linktext="Go To Course" img="/img/search-darth-vader.gif" link="https://rise.articulate.com/share/uGIBV4dMNFn-HzrIMDW_s2Kh4dxMH0vr#/"> ### I'm a course call out title Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out-link> ``` <call-out-link linktext="Go To Course" img="/img/search-darth-vader.gif" link="https://rise.articulate.com/share/uGIBV4dMNFn-HzrIMDW_s2Kh4dxMH0vr#/"> ### I'm a course call out title Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out-link> ## Callouts ### Callout Info ```html <call-out> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ``` <call-out> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ### Callout Warning ```html <call-out type="warning"> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ``` <call-out type="warning"> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ### Callout Beta ```html <call-out type="beta"> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ``` <call-out type="beta"> Montes sociis turpis egestas fermentum tempus lectus cubilia vulputate justo, placerat suscipit mollis nostra mauris at sed adipiscing, enim pharetra laoreet ridiculus litora nunc. </call-out> ## Code Group ````html <code-group langs="Html, JavaScript, Go"> ```html <div class="yay-html">Yay HTML</div> ``` ```javascript consol.log('Yay, JavaScript!') ``` ```go print('Yay, Go!'); ``` </code-group> ```` <code-group langs="Html, JavaScript, Go"> ```html <div class="yay-html">Yay HTML</div> ``` ```javascript consol.log('Yay, JavaScript!') ``` ```go print('Yay, Go!'); ``` </code-group> ================================================ FILE: content/docs/for-developers/parsing-email/inbound-email.md ================================================ --- layout: page weight: 0 title: Inbound Email Parse Webhook group: inbound-parse navigation: show: true --- SendGrid can parse the attachments and contents of incoming emails. Application examples include receiving uploads and posting blog articles via email. The Parse API will POST the parsed email to a URL that you specify. If a POST is unsuccessful, SendGrid automatically queues and retries any POSTs that respond with a 5XX status. This prevents data loss for customers who have misconfigured their website or POST URL. <call-out> Respond with a 2xx status to the POST request to stop the email from retrying. </call-out> To avoid returning an error your link must return a 2xx HTTP code when the email is received. This response lets our system know that your link has received the email. It is then removed from our send queue. If we do **not** get a valid 2xx HTTP response, our servers will believe they have failed to deliver your message. Messages that cannot be delivered after 3 days will be dropped. ## Setup The following steps are required to begin parsing email: - Point the MX Record of a Domain/Hostname or Subdomain to **mx.sendgrid.net** - Associate the Domain/Hostname and the URL in the [Parse API settings page](https://sendgrid.com/developer/reply/). <call-out type="warning"> The Inbound Parse Webhook will not follow redirects. Please make sure to use the correct URL, or posting will fail. </call-out> You must ensure that the subdomain-domain combination for your receiving domain is unique. <call-out type="warning"> Only authenticated domains may be used when configuring Inbound Parse! </call-out> See [Setting Up The Inbound Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) for step-by-step instructions. <call-out> The total message size limit, including the message itself and any number of attachments, is 20MB. Be aware that other mail handlers will have their own limitations, and some ISPs and companies may either dramatically limit the size and/or type of attachments, or even block them altogether. </call-out> ## Character Sets and Header Decoding If you receive an email which is not in ASCII only format, you will want to read this section. Messages and their headers can have character set data associated with them. In order to simplify the parsing of messages for the end user, SendGrid will decode the to, from, cc, and subject headers if needed. All headers will be converted to UTF-8 for uniformity since technically a header can be in many different character sets. The charsets variable will contain a JSON encoded hash of the header / field name and its respective character set. For instance, it may look like: ```ruby [charsets] => {"to":"UTF-8","cc":"UTF-8","subject":"UTF-8","from":"UTF-8","text":"iso-8859-1"} ``` This shows that all headers should be treated as UTF-8, and the text body is latin1. ================================================ FILE: content/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook.md ================================================ --- seo: title: Setting Up The Inbound Parse Webhook description: How to set up the Inbound Parse Webhook to process and parse incoming email keywords: Inbound Parse, Inbound Parse Webhook, Email Processing title: Setting Up The Inbound Parse Webhook group: inbound-parse weight: 90 layout: page navigation: show: true --- As you’re probably aware, SendGrid is great at sending your email, but SendGrid can also help you process email using the Inbound Parse Webhook. The Inbound Parse Webhook processes all incoming email for a domain or subdomain, parses the contents and attachments then POSTs multipart/form-data to a URL that you choose. <call-out> XML is only available in v2. </call-out> What your application does with this parsed data is up to you. For some ideas of what the Inbound Parse Webhook can do, check out this [blog post](https://sendgrid.com/blog/parse-api-oh-what-you-can-do/). <call-out> Check out some pre-made integrations for the SendGrid Inbound Parse Webhook in the [Library Index]({{root_url}}/for-developers/sending-email/libraries/#web-api-libraries). </call-out> ## Setup To begin processing email using SendGrid's Inbound Parse Webhook, you will have to setup MX Records, choose the hostname (or receiving domain) that will be receiving the emails you want to parse, and define the URL where you want to POST your parsed emails. ### Setting up an MX Record 1. Navigate to the MX Records page on your hosting provider’s website. If you’re unsure who your hosting or DNS provider is, please contact your website administrator. 2. Create a new MX record for the subdomain (e.g. parse.yourdomain.com) you want to process incoming email. <call-out> This hostname should be used exclusively to parse your incoming email. </call-out> <call-out type="warning"> Do not change the MX record for your domain. If you do, you will no longer receive email. </call-out> 3. Assign the MX record a priority of 10, and point it to the address: `mx.sendgrid.net.` It should look something like this: ![]({{root_url}}/images/Inbound_Parse_01_MX_Record.png) <call-out> If there is no field for priority, type 10 before the address. e.g. `10 mx.sendgrid.net.` </call-out> ### Pointing to a Hostname and URL 1. From your SendGrid Dashboard click **Settings**, and then click **Inbound Parse**. You are now on the Inbound Parse page. 2. Click **Add Host & URL**. Here you will specify the subdomain and root domain of the receiving domain (or hostname). All emails sent to this receiving domain will be parsed. If you use the same return path (subdomain) as your authenticated domain, you must have Automatic Security disabled on the authenticated domain. Otherwise, those messages will bounce due to an infinite CNAME>MX loop. <call-out> The URL must be accessible from the public web. </call-out> 3. Enter the subdomain (for example, "parse") and select the authenticated root domain for your receiving domain. Enter the public URL where you would like the parsed data to be POSTed. ![]({{root_url}}/images/setting_up_inbound_parse_1.png) 4. (Optional) Check **Spam Check** if you want Inbound Parse to check incoming email for spam. Checking this box will also include the spam report and spam score in the payload. 5. (Optional) Check **Send Raw** if you would prefer to receive the full MIME message URL encoded in multipart/form-data. <call-out type="warning"> If you do not check **Send Raw**, the post will be multipart/form-data with the email content URL encoded, but the attachments will be in multipart/form-data. If your code is only set up to read URL encoding, attachments could be dropped. </call-out> 6. Click Save. You have just finished configuring Inbound Parse! ## Testing To test if everything is working, send an email from your email account to example@example.com. <call-out> The local-part (i.e. anything before @) can be any word or combination because all email for the domain or subdomain will be processed. </call-out> <call-out type="warning"> Remember to direct your incoming email to your hostname (for example, example@example.com). If you do not, your incoming email will not be parsed. </call-out> ## Default Parameters <table class="table"> <colgroup> <col class="table-col-200"> <col> </colgroup> <tbody> <tr> <th>headers</th> <td>The raw headers of the email.</td> </tr> <tr> <th>dkim</th> <td>A string containing the verification results of any DKIM and domain keys signatures in the message.</td> </tr> <tr> <th>content-ids</th> <td>A string containing the number of attachments. </td> </tr> <tr> <th>to</th> <td>Email recipient field, as taken from the message headers.</td> </tr> <tr> <th>Text</th> <td>Email body in plaintext formatting.</td> </tr> <tr> <th>html</th> <td>HTML body of email. If not set, email did not have an HTML body.</td> </tr> <tr> <th>from</th> <td>Email sender, as taken from the message headers.</td> </tr> <tr> <th>sender_ip</th> <td>A string of the sender’s ip address.</td> </tr> <tr> <th>spam_report</th> <td>Spam Assassin’s spam report.</td> </tr> <tr> <th>envelope</th> <td>A string containing the SMTP envelope. This will have 2 variables: <code>to</code>, which is a single-element array containing the address that we received the email to, and <code>from</code>, which is the return path for the message.</td> </tr> <tr> <th>attachments</th> <td>Number of attachments included in email.</td> </tr> <tr> <th>subject</th> <td>Email Subject.</td> </tr> <tr> <th>spam_score</th> <td>Spam Assassin’s rating for whether or not this is spam.</td> </tr> <tr> <th>attachment-info</th> <td>A JSON map where the keys are named attachment{X}. Each attachment key points to a JSON object containing three fields, <code>filename</code>, <code>type</code>, and <code>content-id</code>. The <code>filename</code> field is the name of the file (if it was provided). The <code>type</code> field is the <a href="http://en.wikipedia.org/wiki/Internet_media_type">media type</a> of the file. <code>X</<code> is the total number of attachments. For example, if the number of attachments is 0, there will be no attachment files. If the number of attachments is 3, parameters attachment1, attachment2, and attachment3 will have file uploads. </td> </tr> <tr> <th>charsets</th> <td>A string containing the character sets of the fields extracted from the message.</td> </tr> <tr> <th>SPF</th> <td>The results of the Sender Policy Framework verification of the message sender and receiving IP address.</td> </tr> </tbody> </table> ## Example Default Payload ``` [Date] array(16) { ["headers"]=> string(1970) "Received: by mx0047p1mdw1.sendgrid.net with SMTP id 6WCVv7KAWn Wed, 27 Jul 2016 20:53:06 +0000 (UTC) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) by mx0047p1mdw1.sendgrid.net (Postfix) with ESMTPS id AA9FFA817F2 for <example@example.comom>; Wed, 27 Jul 2016 20:53:06 +0000 (UTC) Received: by mail-io0-f169.google.com with SMTP id b62so81593819iod.3 for <example@example.comom>; Wed, 27 Jul 2016 13:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.com; s=ga1; h=mime-version:from:date:message-id:subject:to; bh=DpB1CYYeumytcPF3q0Upvx3Sq/oF4ZblEwnuVzFwqGI=; b=GH5YTxjt6r4HoTa+94w6ZGQszFQSgegF+Jlv69YV76OLycJI4Gxdwfh6Wlqfez5yID 5dsWuqaVJZQyMq/Dy/c2gHSqVo60BKG56YrynYeSrMPy8abE/6/muPilYxDoPoEyIr/c UXH5rhOKjmJ7nICKu1o99Tfl0cXyCskE7ERW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DpB1CYYeumytcPF3q0Upvx3Sq/oF4ZblEwnuVzFwqGI=; b=Sq6LVHbmywBdt3sTBn19U8VOmelfoJltz8IcnvcETZsYwk96RBxN+RKMN5fOZSKw4j 15HrgdIFfyDmp67YK0ygvOITlTvZ6XY5I0PtnvDtAQt79kS3tKjI3QKJoEp/ZjIjSzlL KG7agl6cxFgBbIN0yHWBOvy3O+ZXY8tZdom1yOvULjmjW1U9JkdOs+aJ6zq4qhZX/RM/ tIgLB461eJ5V95iQDDc5Ibj9Cvy4vJfXLQRO0nLVQAT2Yz58tkEO1bDZpWOPAyUNneIL yhIWp+SpbuqhMA68mq0krG1PjmWalUbpVcGJIGuOKB9mQFFo/MqdrUCjvYnyo1jPLPeX psdQ== X-Gm-Message-State: AEkoousvdxmDoxLlTUYJ1AOmCGJv77xRBBlfKv6YrthH0M2NueMwlOxUD6t8nidE9uonXbdJ/DQy/chmHUnN//a4 X-Received: by 10.107.6.101 with SMTP id 98mr38024553iog.41.1469652785829; Wed, 27 Jul 2016 13:53:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.48.17 with HTTP; Wed, 27 Jul 2016 13:53:05 -0700 (PDT) From: Sender Name <example@example.com> Date: Wed, 27 Jul 2016 14:53:05 -0600 Message-ID: <CAN_P_JMvV7ZpAQhOnDienypLrJmuhN=LQWweu4yScw4jQyXY2w@mail.gmail.com> Subject: Different File Types To: example@example.comom Content-Type: multipart/mixed; boundary=001a113f8ad03e85160538a4343c " ["dkim"]=> string(22) "{@sendgrid.com : pass}" ["content-ids"]=> string(37) "{"ii_1562e2169c132d83":"attachment1"}" ["to"]=> string(26) "example@example.comom" ["html"]=> string(479) "<div dir="ltr">Here's an email with multiple attachments<div><br></div><div><img src="cid:ii_1562e2169c132d83" alt="Inline image 1" width="455" height="544"><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><img src="https://sendgrid.com/brand/sg-logo-email.png" width="96" height="17"><br><div><br></div></div></div> </div></div> " ["from"]=> string(33) "Sender Name example@example.com" ["text"]=> string(139) "Here's an email with multiple attachments " ["sender_ip"]=> string(14) "209.85.223.169" ["spam_report"]=> string(844) "Spam detection software, running on the system "mx0047p1mdw1.sendgrid.net", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Here's an email with multiple attachments [image: Inline image 1] -- [...] Content analysis details: (2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.8 HTML_IMAGE_RATIO_02 BODY: HTML has a low ratio of text to image area 0.0 HTML_MESSAGE BODY: HTML included in message 1.8 HTML_IMAGE_ONLY_08 BODY: HTML: images with 400-800 bytes of words 0.0 T_MIME_NO_TEXT No text body parts " ["envelope"]=> string(66) "{"to":["example@example.comom"],"from":"example@example.com"}" ["attachments"]=> string(1) "2" ["subject"]=> string(20) "Different File Types" ["spam_score"]=> string(5) "2.597" ["attachment-info"]=> string(287) "{"attachment2":{"filename":"DockMcWordface.docx","name":"DockMcWordface.docx","type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},"attachment1":{"filename":"MG_2359.jpg","name":"_MG_2359.jpg","type":"image/jpeg","content-id":"ii_1562e2169c132d83"}}" ["charsets"]=> string(77) "{"to":"UTF-8","html":"UTF-8","subject":"UTF-8","from":"UTF-8","text":"UTF-8"}" ["SPF"]=> string(4) "pass" } ``` ## Raw Parameters <table class="table table-bordered table-striped"> <colgroup> <col class="table-col-200"> </colgroup> <tbody> <tr> <th>dkim</th> <td>A string containing the verification results of any DKIM and domain keys signatures in the message.</td> </tr> <tr> <th>Email</th> <td>A string containing the email headers, date, body, and attachments</td> </tr> <tr> <th>To</th> <td>Email recipient field as taken from the message headers.</td> </tr> <tr> <th>cc</th> <td>Email cc field, as taken from the message headers.</td> </tr> <tr> <th>From</th> <td>Email sender, as taken from the message headers.</td> </tr> <tr> <th>Text</th> <td>Email body in plaintext formatting.</td> </tr> <tr> <th>html</th> <td>HTML body of email. If not set, email did not have an HTML body.</td> </tr> <tr> <tr> <th>Sender IP</th> <td>Email sender IP address.</td> </tr> <tr> <th>Spam Report</th> <td>Spam Assassin’s spam report.</td> </tr> <tr> <th>Envelope</th> <td>A string containing the SMTP envelope. This will have 2 variables: <code>to</code>, which is an single-element array containing the addresses that received the email, and <code>from</code>, which is the return path for the message.</td> </tr> <tr> <th>Subject</th> <td>Email subject.</td> </tr> <tr> <th>Spam_Score</th> <td>Spam Assassin’s rating for whether or not this is spam.</td> </tr> <tr> <th>Charsets</th> <td>A string containing the character sets of the fields extracted from the message.</td> </tr> <tr> <th>SPF</th> <td>The results of the Sender Policy Framework verification of the message sender and receiving IP address.</td> </tr> </tbody> </table> <call-out> We recommend limiting the total size of your message, including the message itself and all attachments, to 30MB. Be aware that other mail handlers will have their own limitations, and some ISPs and companies may either dramatically limit the size and/or type of attachments, or even block them altogether. </call-out> ## Example Raw Payload ``` array(11) { ["dkim"]=> string(22) "{@sendgrid.com : pass}" ["email"]=> string(8879) "Received: by mx0032p1mdw1.sendgrid.net with SMTP id rOkt2xLLKV Tue, 19 Jul 2016 15:06:29 +0000 (UTC) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) by mx0032p1mdw1.sendgrid.net (Postfix) with ESMTPS id 26D6080397 for <parse@parse.yourdomain>; Tue, 19 Jul 2016 15:06:22 +0000 (UTC) Received: by mail-it0-f45.google.com with SMTP id f6so93587860ith.1 for <example@example.comom>; Tue, 19 Jul 2016 08:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.com; s=ga1; h=mime-version:from:date:message-id:subject:to; bh=UYWCIUKTVXyV9U41l+c9+qOlpoeQGcJkKpyOAatNr3Y=; b=c1I/LcqHEJklmAThWr9Z8NKlTPHUlE/8sDSpK382fJtIQcGdUtczG0pijnUHegrFVt FDr4NehtJDD9KFvXLXboLCtObsu5HTN99ckUCCZTibZseA+J8U3jjCqTdj1fmUage5C7 //Iwi0Ndioonzhm18J7KStap66yZ69ED7UxPk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=UYWCIUKTVXyV9U41l+c9+qOlpoeQGcJkKpyOAatNr3Y=; b=lgmLXnmmpNcQMckjshsZsa2/8OjFZzntWYSG5XZo0fi32KHLuBLSHuNDFXn0V4ICp1 1xuT2fZCyhBSgNBiWNbjqFspdemzrBjaI1Tgm/Zz8Fv6wW2XdjpoANNQzJxfdhnecPd5 HvZ5P8+KTqjr4tAa9RmLthDc3UqhV9NRnCnhbW/AZaVQLB8eoJus92tD1GeXpBQml5XF m6vPUGrWGZWNugINkRKxIpk+2uECglAjNm4NpZIi9j7N94CxA18RC4NJ59WIsSybtIer hbCgT1Q13rvGEzvnp6FfFQVbE3DOibNqd0bh/EvZCagFVbnenNc/Q+qHtU9KqFlisSOp xh0w== X-Gm-Message-State: ALyK8tINVaZIP8YCgQbpg5ya8EnqQo76uxkXUPpDnM+kAyAQQzehFU10EgyuAe2fAmWf/muBiFDy0JDU74Eclp1/ X-Received: by 10.36.76.16 with SMTP id a16mr4479786itb.77.1468940781988; Tue, 19 Jul 2016 08:06:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.48.17 with HTTP; Tue, 19 Jul 2016 08:06:21 -0700 (PDT) From: Sender Name <example@example.com> Date: Tue, 19 Jul 2016 09:06:21 -0600 Message-ID: <CAN_P_JNa25--hzm5=-ES9cnxgWa+h+E49OOAS7sPpV0gsoXCOw@mail.gmail.com> Subject: Hello To: example@example.comom Content-Type: multipart/mixed; boundary=001a11447dc881e40f0537fe6d5a --001a11447dc881e40f0537fe6d5a Content-Type: multipart/alternative; boundary=001a11447dc881e40b0537fe6d58 --001a11447dc881e40b0537fe6d58 Content-Type: text/plain; charset=UTF-8 This is a test email with 1 attachment. --001a11447dc881e40b0537fe6d58 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">This is a test email with 1 attachment.<br clear=3D"all"><= div><br></div>-- <br><div class=3D"gmail_signature" data-smartmail=3D"gmail= _signature"><div dir=3D"ltr"><img src=3D"https://sendgrid.com/brand/sg-logo= -email.png" width=3D"96" height=3D"17"><br><div><br></div></div></div> </div> --001a11447dc881e40b0537fe6d58-- --001a11447dc881e40f0537fe6d5a Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document; name="DockMcWordface.docx" Content-Disposition: attachment; filename="DockMcWordface.docx" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iqtleujy0 UEsDBBQACAgIAHc+80gAAAAAAAAAAAAAAAASAAAAd29yZC9udW1iZXJpbmcu eG1spZJBboMwEEVP0Dsg7xNIF1WFQrNo1G66a3uAiTFgxfZYYwPN7euEAC2V KkpXCMb//e/hb3cfWkWNICfRZGyzTlgkDMdcmjJj729Pq3sWOQ8mB4VGZOwk HNs93Gzb1NT6ICiciwLCuFTzjFXe2zSOHa+EBrdGK0wYFkgafHilMtZAx9qu OGoLXh6kkv4U3ybJHbtiMGM1mfSKWGnJCR0W/ixJsSgkF9dHr6A5vp1kj7zW wviLY0xChQxoXCWt62l6KS0Mqx7S/HaJRqv+XGvnuOUEbdizVp1Ri5RbQi6c C1/33XAgbpIZCzwjBsWcCN89+yQapBkw53ZMQIP3Onhfl3ZBjRcZd+HUnCDd 6EUeCOj0MwUs2OdXvZWzWjwhBJWvaSjkEgSvgHwPUEsICvlR5I9gGhjKnJez 6jwh5RJKAj2W1P3pz26SSV1eK7BipJX/oz0T1pbFD59QSwcIJ5yx3VgBAAC7 BAAAUEsDBBQACAgIAHc+80gAAAAAAAAAAAAAAAARAAAAd29yZC9zZXR0aW5n cy54bWyllMFuozAQhp9g3wH5nkCqardCJZXaqnvZPaV9gIltwIrtscYGNm+/ JgTYZqWKpieMx/P94/GvuX/4Y3TSSvIKbcE264wl0nIUylYFe3t9Wd2xxAew AjRaWbCj9Oxh++2+y70MIZ7ySSRYnxtesDoEl6ep57U04NfopI3BEslAiL9U pQbo0LgVR+MgqL3SKhzTmyz7zs4YLFhDNj8jVkZxQo9l6FNyLEvF5fkzZtAS 3SHlGXljpA0nxZSkjjWg9bVyfqSZa2kxWI+Q9qNLtEaP5zq3RE0QdLHRRg9C HZJwhFx6H3efh+BE3GQLGtgjpowlJbzXHCsxoOyE6c1xAZq011H73LQTar7I 3AuvlxQyhH6pPQEd/68Crujnv/lOLXLxBSFmhYYmQ16D4DVQGAH6GoJGfpDi CWwLk5lFtcjOFyShoCIws0n9p152k13YZVeDkzOt+hrtJ2Hj2DYOIKG803B8 BH6o4qYVJ6Gky1uIXtqw9HRIltDo8Ar7XUA3Bn/cZEN4GETzajcMtQlyy+LS gonmfjezfqOQfaghtfw6vWQ6a6bzDN3+BVBLBwiI6qJIqQEAAIgFAABQSwME FAAICAgAdz7zSAAAAAAAAAAAAAAAABIAAAB3b3JkL2ZvbnRUYWJsZS54bWyl lE1OwzAQhU/AHSLv26QsEIqaVogKNuyAA0wdJ7Fqe6yxk9Db4zZ/UCQUysqK J+974/GT19sPraJGkJNoMrZaJiwShmMuTZmx97enxT2LnAeTg0IjMnYUjm03 N+s2LdB4FwW5canmGau8t2kcO14JDW6JVphQLJA0+PBJZayBDrVdcNQWvNxL Jf0xvk2SO9ZjMGM1mbRHLLTkhA4Lf5KkWBSSi34ZFDTHt5PskNdaGH92jEmo 0AMaV0nrBpq+lhaK1QBpfjtEo9XwX2vnuOUEbbgLrTqjFim3hFw4F3Z3XXEk rpIZAzwhRsWcFr57Dp1okGbEnJJxARq9l8G7H9oZNR1kmoVTcxrpSi9yT0DH n13AFfP8qrdyVoovCEHlaxoDeQ2CV0B+AKhrCAr5QeSPYBoYw5yXs+J8Qcol lAR6Cqn7082ukou4vFZgxUQr/0d7Jqwt2/SvT9SmBnSI3gNJUCzerOP+Wdp8 AlBLBwhpMWDsagEAANgEAABQSwMEFAAICAgAdz7zSAAAAAAAAAAAAAAAAA8A AAB3b3JkL3N0eWxlcy54bWzdV+1u2jAUfYK9A8r/NiEEhlBphai6Taq6ae0e wDgO8XBsy3ag7OlnJ04CCZkyoKMa/Eh8r++518fHH7m5e01Ib42ExIxOnf61 5/QQhSzEdDl1frw8XI2dnlSAhoAwiqbOFknn7vbDzWYi1ZYg2dPxVE4SOHVi pfjEdSWMUQLkNeOIamfERAKUboqlmwCxSvkVZAkHCi8wwWrr+p43ciwMmzqp oBMLcZVgKJhkkTIhExZFGCL7KCJEl7x5yD2DaYKoyjK6AhFdA6MyxlwWaMmx aNoZFyDrPw1inZCi34Z3yRYKsNGTkZA80YaJkAsGkZTaep87S8S+14FAA1FG dClhP2dRSQIwLWGMNGpAZe5rnduSlkFVA6m4kKRLIbnrES8EENtmFeAIPnfj Oe6k4hqCjlKpKAV5DASMgVAFADkGgTC4QuEc0DUoxRwuO8m5hhRisBQgqUQq /2pm+15NLs8x4KhCW56G9kmwlDu3evsJGbxHEUiJkqYpvgnbtK3s8cCokr3N BEiI8dSZCQy05DYTKHcaCEg1kxjsmOIZlWV/10AttHUNtEq9vI1rbZkAQuaA y7pdCbxCNSNkhInSlv1s71+F1fcLy1zWbWlhoHpLzk16B1czgpe0cC2ARATn btcS4tZp4vWWeawQ4k/oVdVqNuZHDVgf4AaHbDPXPAtGClff1s4B1HNm+I8U EiZEvy+QVh+yDVOiHtjHUdH4nhJtAKlilmcaGg+KlI0QeBkX7xEWUj1mELaa n7CowYTYwXM7+N3hug0FZeeZjlZbrvE4EGYd8NjkyVxfwqnzZNZNppAwjzRj NcEUJKialaxTnjsLbcIrsCBoD/rFWDrhZz17Tx2yHB7EZwTM8d4EjnNHz06f kVD4tVRUlVBH7ehj194ioX6LhNp00vf3lBJ4Xps8oBaeTpQC8lyCVNBuWZHd EKr1FXjN9ZXbdlbLMbT6rbT674zWwehctNY3x4rmwYFtLLedSPOglebBpWke 77PsvxXLe6dIMDD/xikyPnCKjM9Af9BKf/C+6PfH56J/j+5R9mvQHRygOzgD 3cNWuofvjO7gX9Ldekc6ke5RK92j/5VuXEt8EfpfsNK3osZ9J7NemPfR4bvr 2e4jwwNkDk8i8zldqIN8lo4LUzrw34TTM3701T/yOiyKwYF75aDlXlm8ydvf UEsHCCJgqpxzAwAAhxMAAFBLAwQUAAgICAB3PvNIAAAAAAAAAAAAAAAAEQAA AHdvcmQvZG9jdW1lbnQueG1spZXfbtsgFMafYO8QcZ/YibKpsur0YlF3s01R 2z0AAWyjAAcdcNLs6Qf+2yVV5WW+QZzD+X2f4QjuH161mh0FOgkmJ8tFSmbC MODSlDn59fI4vyMz56nhVIEROTkLRx42n+5PGQdWa2H8LBCMyzTLSeW9zZLE sUpo6hZghQnJAlBTH6ZYJpriobZzBtpSL/dSSX9OVmn6hXQYyEmNJusQcy0Z goPCx5IMikIy0Q19BU7RbUu2neVGMUGhggcwrpLW9TR9Ky0kqx5y/Ognjlr1 6052ihpHegrHoVUrdALkFoEJ50J02yYH4jKdsIERMVRMsfC3Zu9EU2kGTGyO C9CgvQja3aY1qPFHxr1waoqRNvVd7pHi+doFvWE/39ZbOamLLwihytc4NOQt CFZR9D1A3UJQwA6Cf6XmSIdm5uWkdr4gcUlLpHpsUvdPJ7tML9rluaJWjLTy /2jfEGpLNuEC2lN2KMPM8NkpY6Ag3ASPzUeSJg/8HEcb0uF+4085SbuPdKGt UNfB3XXoaSsKWiv/TmaHb4KN3A7jwMB48eprqp4tZcF4KDjSKBfdJcM6/MjK O5avBbEDeXUp0WTi2ArGVU4w36635fPvUFCFW//z3brhh7tguVqt03b/bPmD Rnd78B5CIy3X7SoPdpwoUfhxhrKs+mnH+Fnrl7MVIRmeEYzJzlzvJOlPKhnf lM0fUEsHCOH0LWYNAgAAmAYAAFBLAwQUAAgICAB3PvNIAAAAAAAAAAAAAAAA HAAAAHdvcmQvX3JlbHMvZG9jdW1lbnQueG1sLnJlbHOtkktqAzEMhk/QOxjt O54kpZQSTzYlkG2ZHsCZ0TyILRtLKZ3b1xTyghC6mKV+o0+fkNebH+/UNyYe AxlYFCUopCa0I/UGvurt8xsoFkutdYHQwIQMm+pp/YnOSu7hYYysMoTYwCAS 37XmZkBvuQgRKb90IXkruUy9jrY52B71sixfdbpmQHXDVLvWQNq1C1D1FPE/ 7NB1Y4MfoTl6JLkzQjOK5MU4M23qUQyckiKzQN9XWM6p0AWS2u4dXhzO0SOJ 1ZwSdPR7THnvi8Q5eiTxMusxZHJ4fYq/+jRe33yw6hdQSwcIY4WdHeEAAACo AgAAUEsDBBQACAgIAHc+80gAAAAAAAAAAAAAAAALAAAAX3JlbHMvLnJlbHON zzsOwjAMBuATcIfIO03LgBBq0gUhdUXlAFHiphHNQ0l49PZkYADEwGj792e5 7R52JjeMyXjHoKlqIOikV8ZpBufhuN4BSVk4JWbvkMGCCTq+ak84i1x20mRC IgVxicGUc9hTmuSEVqTKB3RlMvpoRS5l1DQIeREa6aautzS+G8A/TNIrBrFX DZBhCfiP7cfRSDx4ebXo8o8TX4kii6gxM7j7qKh6tavCAuUt/XiRPwFQSwcI LWjPIrEAAAAqAQAAUEsDBBQACAgIAHc+80gAAAAAAAAAAAAAAAATAAAAW0Nv bnRlbnRfVHlwZXNdLnhtbLWTTU7DMBCFT8AdIm9R4sICIdS0C36WwKIcYOpM Wgv/yTMp7e2ZtCGLqkiwyM7jN/Pe55E8X+69K3aYycZQq5tqpgoMJjY2bGr1 sXop71VBDKEBFwPW6oCklour+eqQkAoZDlSrLXN60JrMFj1QFRMGUdqYPbCU eaMTmE/YoL6dze60iYExcMm9h1rMn7CFznHxeLrvrWsFKTlrgIVLi5kqnvci njD7Wv9hbheaM5hyAKkyumMPbW2i6/MAUalPeJPNZNvgvyJi21qDTTSdl5Hq K+Ym5WiQSJbqXUXILKch9R0yv4IXW9136h+1Gh45DQIfHP4GcNQmjW/FawVr h5cJRnlSiND5NWY5X4YY5UkhRsWDDZdBxpaBQx+/3uIbUEsHCAD+7s4fAQAA ugMAAFBLAQIUABQACAgIAHc+80gnnLHdWAEAALsEAAASAAAAAAAAAAAAAAAA AAAAAAB3b3JkL251bWJlcmluZy54bWxQSwECFAAUAAgICAB3PvNIiOqiSKkB AACIBQAAEQAAAAAAAAAAAAAAAACYAQAAd29yZC9zZXR0aW5ncy54bWxQSwEC FAAUAAgICAB3PvNIaTFg7GoBAADYBAAAEgAAAAAAAAAAAAAAAACAAwAAd29y ZC9mb250VGFibGUueG1sUEsBAhQAFAAICAgAdz7zSCJgqpxzAwAAhxMAAA8A AAAAAAAAAAAAAAAAKgUAAHdvcmQvc3R5bGVzLnhtbFBLAQIUABQACAgIAHc+ 80jh9C1mDQIAAJgGAAARAAAAAAAAAAAAAAAAANoIAAB3b3JkL2RvY3VtZW50 LnhtbFBLAQIUABQACAgIAHc+80hjhZ0d4QAAAKgCAAAcAAAAAAAAAAAAAAAA ACYLAAB3b3JkL19yZWxzL2RvY3VtZW50LnhtbC5yZWxzUEsBAhQAFAAICAgA dz7zSC1ozyKxAAAAKgEAAAsAAAAAAAAAAAAAAAAAUQwAAF9yZWxzLy5yZWxz UEsBAhQAFAAICAgAdz7zSAD+7s4fAQAAugMAABMAAAAAAAAAAAAAAAAAOw0A AFtDb250ZW50X1R5cGVzXS54bWxQSwUGAAAAAAgACAD/AQAAmw4AAAAA --001a11447dc881e40f0537fe6d5a-- " ["to"]=> string(22) "example@example.comom" ["from"]=> string(33) "Sender Name <example@example.com>" ["sender_ip"]=> string(13) "209.85.214.45" ["spam_report"]=> string(798) "Spam detection software, running on the system "mx0032p1mdw1.sendgrid.net", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: This is a test email with 1 attachment. Content analysis details: (0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HTML_MESSAGE BODY: HTML included in message 0.3 HTML_IMAGE_ONLY_04 BODY: HTML: images with 0-400 bytes of words 0.0 T_MIME_NO_TEXT No text body parts " ["envelope"]=> string(73) "{"to":["example@example.comom"],"from":"example@example.com"}" ["subject"]=> string(5) "Hello" ["spam_score"]=> string(5) "0.353" ["charsets"]=> string(47) "{"to":"UTF-8","subject":"UTF-8","from":"UTF-8"}" ["SPF"]=> string(4) "pass" } ``` ## Other Inbound Parse Documentation - [Parse API](https://sendgrid.api-docs.io/v3.0/settings-inbound-parse/create-a-parse-setting) - Manage Inbound Parse Webhook settings using the Parse API (Web API v3). - [Parse Settings Subuser](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/parse_settings) - Get current Parse settings and create, edit, and delete entries using the Subuser API (Web API v2). - [Reseller API Parse Settings](https://www.twilio.com/docs/sendgrid/api/v2/reseller_api/parse_settings) - Get current Parse settings and create, edit, and delete entries using the Reseller API (Web API v2). - [Reseller Customer Subuser Parse Settings](https://www.twilio.com/docs/sendgrid/api/v2/reseller_api/reseller_customer_subuser_api/customer_subuser_parse_settings) - Get current Parse settings and create, edit, and delete entries using the Reseller Customer Subuser API (Web API v2). ## Statistics SendGrid provides [statistics](https://app.sendgrid.com/statistics/parse_webhook) of how many emails are parsed over time. You can specify what is displayed on the graph by adjusting the statistics filters. For more information, please see [Parse Webhook Stats](https://sendgrid.api-docs.io/v3.0/webhooks/retrieves-inbound-parse-webhook-statistics). ================================================ FILE: content/docs/for-developers/partners/account-migration.md ================================================ --- seo: title: Migrating from a partner account description: Sometimes if a SendGrid partner no longer supports SendGrid core functionality, you may want to migrate your account to a regular SendGrid account. keywords: migrate, partner sunset title: Migrating from a partner account group: partner-migration weight: 0 layout: page navigation: show: true --- If you are setting up a new account directly with SendGrid but have previously had an account through one of our partners, there are several things to keep in mind - make sure to stop sending mail until you migrate to a new, warmed up account, and make sure export data from your old account, and clean up the data described here so that you can import it into your new account. ## Before you begin - Pause sending email on your old account. - Login to app.sendgrid.com with your current SendGrid username and password. ## Update sender authentication You cannot export and import sender authentication data - you need to set this up manually in your new account after you delete the current authentication records from your [DNS]({{root_url}}/User_Guide/Settings/Sender_authentication/How_to_set_up_domain_authentication.html#-DNS) provider. If you have a domain, link, and IP authentication set up, remove 5 CNAME or MX/TXT records and 1 A record from your domain’s DNS. To verify the records delete from your DNS, go to the [Sender Authentication page](https://app.sendgrid.com/settings/sender_auth) in the UI and check the DNS column: ![]({{root_url}}/img/dns-records.jpg "Where to find your existing DNS records") To set up sender authentication in your new account, check out [Setting up domain authentication]({{root_url}}/User_Guide/Settings/Sender_authentication/How_to_set_up_domain_authentication.html), [Setting up reverse DNS]({{root_url}}/User_Guide/Settings/Sender_authentication/How_to_set_up_link_branding.html), and [Setting up link branding]({{root_url}}/User_Guide/Settings/Sender_authentication/How_to_set_up_link_branding.html). ## Migrate unsubscribes To download your unsubscribes, on the [Global unsubscribes page](https://app.sendgrid.com/suppressions/global_unsubscribes), select the action menu, and then click **Download a CSV**. To set up your unsubscribes in your new account, copy them into the UI by going to [Global](https://app.sendgrid.com/suppressions/global_unsubscribes) or [Group](https://app.sendgrid.com/suppressions/group_unsubscribes) Unsubscribes page, selecting the action menu and then adding them to the list. You can add them with the API by using the [Suppressions methods](https://sendgrid.api-docs.io/v3.0/suppressions-global-suppressions/add-recipient-addresses-to-the-global-suppression-group) ## Migrate templates From the [Marketing Campaigns templates](https://sendgrid.com/marketing_campaigns/ui/marketing_templates) and the [Transactional templates](https://sendgrid.com/dynamic_templates) pages in the UI, export the HTML of any templates you want to migrate. To add your templates in the new account, navigate to either the [Marketing Campaigns templates](https://sendgrid.com/marketing_campaigns/ui/marketing_templates) or the [Transactional templates](https://sendgrid.com/dynamic_templates) page in the UI, create a new template, select to [use the code editor]({{root_url}}/User_Guide/Marketing_Campaigns/editor.html), and paste the HTML of the exported template into the editor. ## Migrate Marketing Campaigns Contacts From the [Marketing Campaigns contacts](https://sendgrid.com/marketing_campaigns/ui/contacts) page, click into your [Global All Contacts](https://sendgrid.com/marketing_campaigns/ui/all_contacts) list. Then export a CSV of your contacts. To upload your contacts into your new account, from the [Contacts page](https://sendgrid.com/marketing_campaigns/ui/contacts), click **Add contacts** and then *Upload CSV*. ## Review existing API keys If you are using the SendGrid API, double check your accounts [list of API keys](https://app.sendgrid.com/settings/api_keys). API keys are not exportable, but it's good to make sure that you're aware of all of the existing API keys in your account so that you can create new ones to match in your new account and update your integrations with the new API keys. ## Delete teammates Teammate names have to be unique across SendGrid, so if you want to continue to use your teammate name, delete it from your original account to add it to your new account. ## Create new subusers If you are using subusers, navigate to the [subusers page](https://app.sendgrid.com/settings/subusers) in the UI and click **Export data** to download all of the information on your current subusers. To add subusers to your new account, go to the [subusers page](https://app.sendgrid.com/settings/subusers) in the UI, and click **Create a new subuser**. Use the data from the exported CSV to create a new subuser. ## Migrate dedicated IPs If you are using a dedicated IP, our support team can migrate your dedicated IP for you. Access support contact options by logging into https://support.sendgrid.com. Provide us with: your current and new usernames, the IP addresses, and your preferred time for the IP transfer - we can migrate IPs between 7 am and 5 pm MST on Monday through Friday. Be sure to set up reverse DNS and rewarm up your transferred IP before you start sending on it in your new account. You also need to reassign it to subusers if needed. ## Download statistics and email activity On all of the statistics pages and on the email activity page, click **Export CSV** to download your statistics for your records. Your new account cannot import this data. ================================================ FILE: content/docs/for-developers/partners/amazon-marketplace.md ================================================ --- layout: page weight: 90 title: Amazon Marketplace group: platform-partners navigation: show: true --- SendGrid has partnered with Amazon to offer our email services on the [Amazon Marketplace](https://aws.amazon.com/marketplace/pp/B074CQY6KB). Built by developers for developers, SendGrid offers developers simple SMTP and API integrations to start sending in minutes. Non-technical users can leverage Marketing Campaign's intuitive interface to create, send, and analyze marketing emails. Once you have an AWS account, you can to [subscribe to SendGrid](https://aws.amazon.com/marketplace/pp/B074CQY6KB) and access it directly from the [AWS Management Console](https://console.aws.amazon.com/). Once you’ve subscribed to SendGrid, you have access to the [SendGrid application](https://app.sendgrid.com/) and the APIs. Use the AWS Management Console if you want to reset your password, cancel your account, or manage bills. ## Getting started *To quickly get started with SendGrid:* - See [Getting Started With Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) for all of the tools you need to get started sending with the SendGrid application. - Look at the [API Reference]({{root_url}}/api-reference/) for all of the API endpoints as well as information about using SMTP and the Webhooks. - See the [API Libraries]({{root_url}}/for-developers/sending-email/libraries/) page for information about using the SendGrid code libraries in C#, Go, Java, Node.js, PHP, Python, and Ruby. <call-out> If you are using SendGrid through AWS, you cannot change your SendGrid username. </call-out> <call-out> **Warm up your sending** - Since ISP spam filters look at volume as a significant factor when determining whether or not you are sending spam, we recommend that you begin sending a low to moderate volume, eventually working your way up to larger volumes. This gives the receiving email providers a chance to closely observe your sending habits and the way your customers treat the emails they receive from you. For more information, see [IP Warmup](https://sendgrid.com/docs/glossary/ip-warmup/). </call-out> ### Pricing There are two plans: AWS Basic and AWS Pro. These plans are billed on your AWS invoice. For more information, check out our [AWS Marketplace page](https://aws.amazon.com/marketplace/pp/B074CQY6KB). Here's a monthly view of cost: ![]({{root_url}}/images/aws_pricing.png "AWS pricing") ### Adding a dedicated IP address You can purchase IP addresses dedicated to your account. Since you are the only one sending email over this IP, your sending practices determine the sender reputation associated with this IP. You can purchase up to 3 IP addresses per month. If you need more than 3 IPs, then you should [contact support](https://support.sendgrid.com/hc/en-us). You can only add a Dedicated IP Address if you are on an AWS Pro plan. To upgrade your plan, see [Upgrading or Downgrading Your Account](#upgrading-or-downgrading-your-account). *To add a dedicated IP Address*: 1. Navigate to the [Plan & Billing Details page](https://app.sendgrid.com/settings/billing) in the SendGrid UI. 2. Click **Add a Dedicated IP**. ![]({{root_url}}/images/dedicated_ip_button.png "Dedicated IP button") This takes you to the Dedicated IP Addresses page 3. Next, click **Add an IP Address**. 4. Select the number of IP Addresses to add, and select whether you want to warm up your IP automatically. Warming up an IP gradually increases the amount of email sent over this IP over time to improve your email deliverability. For more information, see [Warming Up IPs]({{root_url}}/ui/sending-email/warming-up-an-ip-address/). 5. Click **Add**. ### Adding domain authentication and link branding Sender authentication shows email providers that SendGrid has your permission to send emails on your behalf. Domain authentication works by pointing DNS entries from your domain registrar to SendGrid, which drastically increases your ability to deliver email and allows you to begin building a sender reputation for your domain and for your IP addresses. For more information on domain authentication, see [How to Set Up Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). ### Adding subusers You can only add Subusers if you are on an AWS Pro plan. To upgrade your plan, see [Upgrading or Downgrading Your Account](#upgrading-or-downgrading-your-account). Subusers are SendGrid accounts that belong to a parent account. They have their permissions and credit limits, which you assign as you create the Subusers. Subusers help you segment your email sending and API activity. To get started with using Subusers, see the [Subusers overview]({{root_url}}/ui/account-and-settings/subusers/). ### Upgrading or downgrading your account You can upgrade or downgrade your account from the [SendGrid UI](https://app.sendgrid.com/settings/billing). *To change your account plan:* 1. Navigate to the [Plan & Billing Details page](https://app.sendgrid.com/settings/billing) in the SendGrid UI. 1. Select Upgrade to AWS Pro, or Downgrade to AWS Basic. ![]({{root_url}}/images/aws_upgrade.png "AWS upgrading or downgrading") ### Managing billing options Manage your billing options from the [AWS Billing & Cost Management Dashboard](https://console.aws.amazon.com/billing/). ### Canceling your SendGrid subscription *To remove SendGrid from your AWS account:* 1. Navigate to your [Software Subscriptions page](https://aws.amazon.com/marketplace/library?productType=saas&ref_=lbr_tab_saas) on AWS. 1. Click **Cancel Subscription** in the SendGrid section. ![]({{root_url}}/images/aws_cancel.png "AWS cancel button") ### Troubleshooting If you run into issues with your AWS SendGrid account, you can contact our support team by [logging in here](https://support.sendgrid.com) and opening a support ticket. ================================================ FILE: content/docs/for-developers/partners/azure.md ================================================ --- layout: page weight: 0 group: platform-partners title: Building an iOS App on Windows Azure navigation: show: true --- ## Point and click setup in Microsoft Azure You can control a website, mobile backend and SendGrid all from within the Microsoft Azure management portal. We will cover all 3 of these in this tutorial. To start, create a SendGrid account from the management portal: 1. Click **New** at the bottom left. ![]({{root_url}}/images/azure_1.png) 2. Click **Store** to load up the list of Add-ons. 3. Select **SendGrid**. ![]({{root_url}}/images/azure_2.png) 4. Then click the arrow at the lower right to go to step 2. 5. Choose the Free plan for now for 25,000 free emails per month. ![]({{root_url}}/images/azure_3.png) 6. Proceed to step 3 and click **Purchase**. *To create a Windows Azure Website:* 1. Click **New** at the bottom left. 2. Select **Website**, then **Quick Create**. ![]({{root_url}}/images/azure_4.png) 3. Set the URL, such as `website.azurewebsites.net`. 4. Click **Create Web Site** on the bottom right. That’s it! You now have a website running on Azure. Now let’s create something cool. ## Connect to the SendGrid Inbound Parse API SendGrid can both send and receive an email for your domain name. The playlist app uses incoming mail, which means setting up DNS at your domain registrar or host. The process to do this is going to be different depending on who controls your DNS. This tutorial will walk through the Azure and SendGrid part of this process, but you may need to ask for help on changing DNS in your system. It’s a good idea to choose a subdomain like playlist.example.com, rather than a domain itself. That’s because the Inbound Parse API must collect all mail and you don’t want to interrupt another email for your domain. To use custom domains in Windows Azure, your website will need to run in either Shared mode or the Standard tier; however, Shared mode is currently not available. Find your IP address and note the further instructions in the management portal: 1. Select your website from the list and then click SCALE on the top menu bar. ![Select]({{root_url}}/images/azure_5.png) 2. Change the Web Site Mode to Shared, click **Save**, then select **Yes**. 3. Click **Configure** at the top menu bar, then scroll down to click **Manage Domains**. 4. Add your full subdomain plus domain, like playlist.example.com and click the check mark ![Add]({{root_url}}/images/azure_6.png) 5. Note the IP address and the instructions on this page. You’ll use these at your host or registrar when you modify your DNS settings. Now you need to update your own DNS settings outside of the Windows Azure interface. This points your domain’s web traffic to Microsoft Azure and your email to SendGrid. How you change your DNS depends on where your DNS is administered, which could be your host or domain registrar. You’ll need to make 3 updates to your DNS: 1. Create an A record for playlist.example.com that points to the IP noted above 2. Create a CNAME record according to the instructions on the screen where you obtained the IP Address 3. Create an MX record pointing to mx.sendgrid.net. DNS changes can take an hour or more to propagate. Back at Windows Azure’s domain management page, wait for the red exclamation point to become a green checkmark. While you're waiting for DNS to be ready, you can prepare your SendGrid Incoming Parse API webhook. From the Windows Azure interface: 1. Click the **SendGrid App Service** from your all items list. 2. In the management section, select **Go to the SendGrid website for next steps**. ![Click]({{root_url}}/images/azure_7.png) 3. Now you’re looking at the SendGrid interface--click **Developers** at the top. 4. Click PARSE INCOMING EMAILS on the right and you’ll see some fields to fill out ![Click]({{root_url}}/images/azure_8.png) 5. Fill in the values you’ve used for your hostname and URL. For example: * Hostname: `playlist.example.com` * URL: `http://website.azurewebsites.net/email` 6. Click **Add Host & URL**. Once the DNS has propagated, you’ll be able to receive an email to any email address `@playlist.example.com`. In the next step, we’ll make sure your website on Microsoft Azure is ready to accept those emails. ## Prepare the code to run on Microsoft Azure Before you can put the code in place, you need to prepare your source control system, which will be Git in this case. Make sure you have Git installed on your local machine before proceeding. There are downloads for Windows, Mac, Linux, and Solaris. Now set up your repository within the Windows Azure interface: 1. Click the website name from your all items list. 2. Under quick glance, click **Set up deployment from source control**. 3. Choose **local git repository**. 4. Copy the Git URL to your clipboard--you will need it later, and it should look similar to `https://username@subdomain.scm.azurewebsites.net/playlist.git` Now you need to set some environment variables, so you don’t expose these credentials in your code. Follow these steps to find those credentials: *To find your SendGrid credentials within the Windows Azure management portal:* 1. Click **SendGrid** from the all items list. 2. In the bar on the bottom, click **Connection Info**. ![In]({{root_url}}/images/azure_9.png) 3. A screen will pop up with your password, SMTP server, and username To get your Spotify API Key, which you'll use to create your playlist, follow the instructions here: [https://developer.spotify.com/documentation/general/guides/app-settings/](https://developer.spotify.com/documentation/general/guides/app-settings/). With the credentials in hand, it’s time to add them as environment variables within the Windows Azure management portal: 1. Choose your website from the all items list, then click **Configure**. 2. Under “app settings” set the following KEY VALUE pairs * `SENDGRID_USER = username` * `SENDGRID_PASS = password` * `DOMAIN = playlist.example.com` * `CLIENT_ID = your_key` * `CLIENT_SECRET = your_secret` * `XHR_POLLING_ONLY = 1` 3. Click SAVE at the bottom With your source control and environment variables set, it’s time to download the code that makes this app run. You will then upload that code to your Azure account. Open up your command line on your local machine and prepare it for code: 1. Create a local folder to house the code (e.g. `mkdir playlist`) 2. Clone the code into that directory by executing this command: `git clone git://github.com/theycallmeswift/playlist.sendgriddemos.com.git` 3. `cd playlist.sendgriddemos.com` 4. `git remote add azure git_url` * This is the long URL you saved from Microsoft Azure after setting up source control. 5. `git push azure master` * This is the command that pushes the code to Azure cloud One last thing, you need to update the receiving email address: 1. Open up `public/index.html` 2. Change the email in `index.html` (line 25) to the email address you want to use. Something like `play@playlist.example.com` 3. `git add .` * This adds the modified file for upload 4. `git commit -m "Updating email address"` 5. `git push azure master` * Again, this pushes the code to Azure cloud With your changes pushed to Azure, you can restart the server with the button at the bottom of the web server’s dashboard. Then click the BROWSE button within the same menu to see your website live. At this point, people can send in their song requests, assuming that the DNS has propagated. ## Add a backend using Microsoft Azure Mobile Services Microsoft Azure can also run a backend-as-a-service for your app, which allows you to store data, authenticate users, send push notifications, and do other common mobile tasks. This backend can also be used for non-mobile applications. Follow these steps to enable Mobile Services from the Microsoft Azure interface: 1. Click NEW at the bottom left, select MOBILE SERVICE, then click **Create**. 2. Choose a URL -- this is up to you, it will be internal to your app ![Choose]({{root_url}}/images/azure_10.png) 3. Click **Next**. 4. Choose a Server Login Name and Password 5. Choose **Configure advanced database settings**. ![Choose]({{root_url}}/images/azure_11.png) 6. Click **Next**, then review and click **Complete**. *To add a table to the database:* 1. Click on the name of your mobile service to access its settings 2. Click **Data**, then Add a Table 3. Choose a table name, update permissions and click **Complete**. ![Choose]({{root_url}}/images/azure_12.png) In your `index.html` file add the following code near the closing body tag to add the Windows Mobile Services library to your app: ``` html <script src="https://website.azure-mobile.net/client/MobileServices.Web-1.0.0.min.js"></script> ``` ![Mobile Services]({{root_url}}/images/azure_13.png) In the `js/app.js` file, after the `$("#queue").append…` line, add the following code: ``` javascript var client = new WindowsAzure.MobileServiceClient("https://website.azure-mobile.net/", "<Password>"); var item = { request: data.name, song: data.track, user: data.user }; client.getTable("playlist_songs").insert(item); ``` To allow for your app to have access to the DB, add your URL to the cross-origin resource sharing (cors) setting. ![cors]({{root_url}}/images/azure_14.png) Add your changes via git and push to Azure. Now your website, mobile service, and SendGrid account are all in harmony on Microsoft Azure. You could stop here, but to see the real power of Mobile Services, you’ll want to create a native mobile application. ## Connect Microsoft Azure Mobile Services to iOS The Microsoft Azure Mobile Services SDK simplifies the process of standing up a backend for your app in Microsoft Azure. The Microsoft Azure team also has SDKs for Android, HTML, Windows Store, and Windows Phone. For this example, we are going to use iOS. We can download a pre-packaged mobile app from within the Microsoft Azure interface: 1. Click the name of your mobile service from the all items menu. 2. You should see the quickstart tab. Click iOS then Create a new iOS app. 3. Click **Download** to grab the source code. ![Download]({{root_url}}/images/azure_15.png) To create a native iPhone app, you’ll need to have XCode installed on a Mac. It’s a big download (over 1 GB), so find something to do while you wait. Now you’ll want to edit the sample app you downloaded from Microsoft Azure: 1. Expand the files on your computer and open the project file using XCode. 2. Update the credentials and table name in `QSTodoService.m` with the ones you used when you created your mobile service. ![Credentials]({{root_url}}/images/azure_17.png) 3. Update the function refreshDataOnSuccess in `QSTodoService.m` to return all from the queue. Remove the existing code there and replace it with: ``` objc // Return all song request titles from the table // items: An NSArray of the records that matched your query. // totalCount: The total count of items in all pages of the query, not just those returned in the current page. This value is set to -1, unless you explicitly request the total count in your request. For more info, see Return data in pages. // error: Any error that occurred; otherwise nil. [self.table readWithCompletion:^(NSArray *results, NSInteger totalCount, NSError *error) { [self logErrorIfNotNil:error]; items = [results mutableCopy]; // Let the caller know that we finished completion(); }]; ``` ![Code]({{root_url}}/images/azure_18.png) 4. Now, go to the file QSToDoListViewController.m, and replace the onAdd function’s contents with: ``` objc // Populate the parameters for the SendGrid Web API Call // Find more details about the [Web API here]({{root_url}}/api-reference/). NSString *username = @"<Your SendGrid Username>"; NSString *apikey = @"<Your SendGrid Password>"; NSString *to = @"<Email to Playlist Service from Appendix A>"; NSString *from = @"<From Email Address>"; NSString *fromname = @"<Your Name>"; NSString *text = @"%20"; // Make sure the data received from the text field is formatted properly NSString *subject = [itemText.text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // Generate the Web API call NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.sendgrid.com/api/mail.send.json?to=%@&from=%@&fromname=%@&subject=%@&text=%@&api_user=%@&api_key=%@",to, from, fromname, subject, text, username, apikey]]; // This writes the composed URL in the XCode console for debugging purposes NSLog(@"URL %@",url); // Create a request object using the URL NSURLRequest *request = [NSURLRequest requestWithURL:url]; // Prepare for the response back from the server NSHTTPURLResponse *response = nil; NSError *error = nil; // Send a synchronous request to the server NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; // Error handling if (error != nil) { NSLog(@"%@", [error localizedDescription]); UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Error" message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [message show]; } itemText.text = @""; ``` 5. In the same file, replace this line: ```label.text = [item objectForKey:@"text"];``` with this line: ```label.text = [item objectForKey:@"request"];``` Now you can make some adjustments to the interface: 1. Click on the storyboard, then the **Text Input** field. ![Click]({{root_url}}/images/azure_19.png) 2. On the right, change the placeholder text to read: “Enter your song request” 3. Next, double click on the button and rename it to “Send”. You will have to adjust the size of the text box and button by single clicking and adjusting. ![Buttons]({{root_url}}/images/azure_20.png) Your project in XCode should look like the above screenshot. When you run the iPhone app, you should be able to see requested songs and add your own songs to the shared playlist. The code for this tutorial is available at our [GitHub page](https://github.com/sendgrid/sendgrid-azure-ios/). Enjoy! ================================================ FILE: content/docs/for-developers/partners/google.md ================================================ --- layout: page weight: 0 group: platform-partners title: Google navigation: show: true --- If you are using Google’s cloud platform, you can easily integrate with SendGrid. Simply navigate to the [GCP Marketplace](https://console.cloud.google.com/marketplace/details/sendgrid-app/sendgrid-email), locate the [SendGrid add-on](https://console.cloud.google.com/marketplace/details/sendgrid-app/sendgrid-email), select the appropriate plan, and get ready to start sending. Using Google’s App Engine or Compute Engine? Here are a few examples of how to implement SendGrid to help improve deliverability and provide analytics for your projects. ## App Engine Examples 1. [Python](https://cloud.google.com/appengine/docs/standard/python/mail/sendgrid) 2. [Java](https://cloud.google.com/appengine/docs/standard/java/mail/sendgrid) 3. [PHP](https://cloud.google.com/appengine/docs/standard/php/mail/sendgrid) 4. [Go](https://cloud.google.com/appengine/docs/standard/go/mail/sendgrid) 5. [Node.js](https://cloud.google.com/appengine/docs/standard/nodejs/sending-emails-with-sendgrid) ## Compute Engine If you're using Google's Compute Engine, click [here](https://cloud.google.com/compute/docs/tutorials/sending-mail/using-sendgrid) Check out [our blog](https://sendgrid.com/blog/partnership-includes-google-compute-engine/) for more information on how to make Google and SendGrid work together. ================================================ FILE: content/docs/for-developers/partners/jelastic.md ================================================ --- layout: page weight: 0 group: platform-partners title: Jelastic navigation: show: true --- SendGrid can be implemented in Jelastic's cloud platform. SendGrid and Jelastic interconnection allows you to send emails directly from your Java or PHP application hosted with Jelastic cloud technologies. ### Application Examples 1. [Java with Spring](http://docs.jelastic.com/sendgrid-java) 2. [PHP](http://docs.jelastic.com/sendgrid-php) ================================================ FILE: content/docs/for-developers/partners/microsoft-azure-2021.md ================================================ --- seo: title: Sending Email with Microsoft Azure description: Learn how to send email with Twilio SendGrid's newest Azure integration keywords: Microsoft, Azure, Integration title: Sending Email with Microsoft Azure group: platform-partners weight: 100 layout: page navigation: show: true --- <call-out> This documentation applies to the most recent version of the Twilio SendGrid integration for Microsoft Azure. For documentation on the previous version, see the [SendGrid documentation]({{root_url}}/for-developers/partners/microsoft-azure/) or related [Azure documentation](https://docs.microsoft.com/en-us/azure/sendgrid-dotnet-how-to-send-email). </call-out> This guide will help you create and configure a Twilio SendGrid account using Microsoft Azure. Once your account is ready, you'll be on your way to delivering email at scale. ## Create an Azure Subscription To get started with Twilio SendGrid and Azure, visit the [Azure Portal home page](https://portal.azure.com/#home). You will need to sign in or create a Microsoft account if you do not already have one. Once logged in, select the **Subscriptions** icon under the **Azure services** menu. ![Azure services menu with the Subscriptions icon highlighted]({{root_url}}/img/sg_azure_portal_home_subscription.png 'Azure subscriptions') A new page will load, listing your current subscriptions. You can add Twilio SendGrid to an existing Subscription or Select **+Add** to create a new subscription. For more information about Subscriptions and billing, see the Azure docs for how to "[Create an additional Azure subscription](https://docs.microsoft.com/en-us/azure/cost-management-billing/manage/create-subscription)." For this guide, we will create a new Subscription. ![Azure Subscriptions with the +Add link highlighted]({{root_url}}/img/sg_azure_subscriptions_add.png 'Azure +Add Subscription') If you already have an Azure account set up for billing, you will be taken to a page where you can create a subscription. <call-out> If you are creating your first Azure Subscription, you will first need to select a billing offer for your Subscription. You will be guided through the Azure offer signup process. You can return to this guide once your billing setup is complete. </call-out> A form will load with a **Subscription Name** field. You must add a name — we recommend something that clearly differentiates the subscription. All the other fields are already populated and cannot be edited. Click **Create**. ![Azure Subscriptions form with the Subscription Name populated]({{root_url}}/img/sg_azure_subscription_create.png 'Azure Subscription Name') Once the Subscription is created, you will see it listed on the Subscriptions page. If you do not see the Subscription, try refreshing the list. <call-out> If you have multiple Azure Active Directory tenants, be sure you are viewing the tenant your subscription is assigned to. You can select **Switch directories** to view your additional tenants. For more on Azure AD, see "[Associate or add an Azure subscription to your Azure Active Directory tenant](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-subscriptions-associated-directory)." </call-out> ![A list of all Azure Subscriptions for the account]({{root_url}}/img/sg_azure_subscriptions_listed.png 'Azure Subscriptions') ## Create a Twilio SendGrid account From the Azure portal home page, select **Marketplace** under **Azure services**. If you do not see the **Marketplace** icon, you can search for it by selecting **More services**. ![The Azure portal home page with the Marketplace icon highlighted]({{root_url}}/img/sg_azure_home_marketplace.png 'Azure Marketplace') The Azure Marketplace provides many services, including the Twilio SendGrid email service. You can find it by searching for "Twilio SendGrid." You will also find it under **Software as a Service (SaaS)**. Click the Twilio SendGrid resource to load a page where you can select your account tier. You can start with a free account and upgrade as your sending needs change. See the [Twilio SendGrid pricing page](https://sendgrid.com/pricing/) to understand what's included with each plan. ![The Twilio SendGrid integration listed in the Azure Marketplace]({{root_url}}/img/sg_azure_marketplace_listing.png 'Azure Marketplace Twilio SendGrid listing') ![The Twilio SendGrid integration detail page with a "Setup + Subscripe" link]({{root_url}}/img/sg_azure_listing_setup_subscribe.png 'Azure Marketplace Twilio SendGrid listing detail page') Select **Set up + subscribe**. You will be taken to a page where you can assign your Twilio SendGrid account to an Azure Subscription and Resource Group. Once you have completed the required fields, select **Review + subscribe**. ![The Twilio SendGrid integration configuration basics]({{root_url}}/img/sg_azure_create_sg_account.png 'Azure Marketplace Twilio SendGrid configuration basics') You will be asked to agree to Azure's term of services. You can now review your order and click **Subscribe**. It takes a few moments to establish your account. You will be shown a progress screen. When the setup is complete, you will be able to click the **Configure account now** button to be taken to the Twilio SendGrid App. You will also receive an email when the subscription setup is complete. ![The Twilio SendGrid subscription in progress]({{root_url}}/img/sg_azure_subscription_in_progress.png 'Azure Marketplace Twilio SendGrid subscription in progress') ## Twilio SendGrid account setup Before sending your first email, you will need to complete the following Twilio SendGrid account setup. These requirements help secure your account and keep your messages from landing in spam folders. - Configure Two-factor authentication - Create an API key - Complete Sender Authentication ### Two-factor authentication Twilio SendGrid uses Two-factor authentication (2FA) to help protect your account. To enable 2FA, Navigate to **Two-Factor Authentication** in the Twilio SendGrid **Settings** menu, and click **Add Two-Factor Authentication**. ![The Twilio SendGrid App's Two-factor authentication menu]({{root_url}}/img/sg_azure_2fa_page.png 'Two-factor authentication menu') A modal will open where you can complete the 2FA setup. Click **Ok, Got it** to continue. <call-out type="warning"> If you have previously configured services to authenticate with Twilio SendGrid APIs using Basic Authentication, enabling 2FA will break those integrations. You must use API keys to authenticate with Twilio SendGrid APIs. </call-out> ![A modal asking to confirm 2FA setup]({{root_url}}/img/sg_azure_2fa_modal.png '2FA confirmation') Twilio SendGrid supports 2FA using either SMS or the Authy App. Select your preferred 2FA method, and click **Next**. You will need to enter a phone number to complete the 2FA process. SMS users will be sent a confirmation code at the number they entered. Authy users will be sent instructions for downloading and completing the 2FA setup using the Authy app. ### API keys API Keys authenticate your application, mail client, or website with Twilio SendGrid services. Unlike a username and password, API keys are scoped to provide access only to the services you select. You can also delete and create API keys without impacting your other account credentials. For these reasons, Twilio SendGrid requires you to connect to its services using API keys. #### Create an API key In the Twilio SendGrid App, navigate to **API Keys** in the **Settings** menu, and select **Create API Key**. ![The Twilio SendGrid App's API keys page]({{root_url}}/img/sg_azure_api_keys_page.png 'API keys') A modal will open where you can create your key. You must name the API key — we recommend something that will clearly differentiate the key from others you may create in the future. ![A modal where you can name configure and configure an API key]({{root_url}}/img/sg_azure_api_keys_modal.png 'Name and configure an API key') You must also select the type of key you want to create. Twilio SendGrid provides three types of API key: - Full Access - Restricted Access - Billing Access To keep your account secure, you should give each key the [least privilege](https://www.twilio.com/blog/principle-of-least-privilege-details-best-practices) necessary. You can limit a key's capabilities by creating a **Restricted Access** key and selecting a subset of all the possible permissions. For more about managing Twilio SendGrid API keys, see the [Twilio SendGrid API keys documentation]({{root_url}}/ui/account-and-settings/api-keys/). <call-out> For security reasons, Twilio SendGrid API keys will be displayed to you at the time of creation only. Be sure to copy your key and store it somewhere secure like your [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/). If you lose your key, you must create another — it's not possible to recover a lost key. The permissions assigned to a key can be modified after it's created. </call-out> #### Use an API key Twilio SendGrid's v3 APIs expect an API key to be passed in an Authorization header as a Bearer Token. See the [Twilio SendGrid v3 API reference]({{root_url}}/api-reference/) for help using your key to send your first email. The Twilio SendGrid helper libraries all provide a method to set your key, handling the authentication via Bearer Token for you. See the [Twilio SendGrid developer documentation]({{root_url}}/for-developers/) for helpful code examples and links to helper libraries in C#, Go, Java, Node.js, PHP, Python, and Ruby. When using Twilio SendGrid’s SMTP integration, you will set your API key as a password via Basic Authentication. Your username must always be the string, “apikey.” Using the account credentials (username and password) you set up through Azure will fail, so be sure to set your password to the 14 digit API key provided by the Twilio SendGrid App. Your account credentials are separate from the credentials used to authenticate with Twilio SendGrid’s APIs and SMTP services. ``` username: "apikey" password: <your-api-key> ``` ### Sender Authentication Twilio SendGrid requires customers to complete Sender Authentication. This requirement protects your domain's reputation as an email sender and helps uphold legitimate sending behavior by Twilio SendGrid customers. Setup includes domain authentication. Twilio SendGrid will provide DNS records that you must add to your domain. For instructions on the domain authentication process, see "[How to Set Up Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/)." ## Change, unsubscribe, reactivate your Twilio SendGrid plan You can upgrade or downgrade your Twilio SendGrid plan to accommodate your email sending needs as they change. If you no longer need the Twilio SendGrid service, you will aslo unsubscribe through the Azure portal. From your Azure portal's Subscription overview page, select **Resources** and click your Twilio SendGrid resource (it is labeled "Contoso" in the following examples). ![The Azure resources page with a Twilio SendGrid subscription highlighted]({{root_url}}/img/sg_azure_subscription_resources.png 'The Twilio SendGrid resource') A detail page will load where you can modify your Twilio SendGrid subscription. ![The Twilio SendGrid subscription resource detail page]({{root_url}}/img/sg_azure_resource_detail.png 'The Twilio SendGrid resource detail') ### Upgrade or downgrade your plan To upgrade or downgrade your plan, select **Change plan** from the Twilio SendGrid resource detail page. There are two locations where you can select **Change plan** — selecting **Change subscription** will allow you to modify your Azure subscription, not your Twilio SendGrid plan. ![The Twilio SendGrid Azure resource with the "Change Plan" link highlighted]({{root_url}}/img/sg_azure_change_plan_link.png 'Change plan') A modal will open, displaying the available plans with your current plan selected. Select a new plan, and click **Change plan**. You will see a confirmation message on the page when your plan has been updated. ### Unsubscribe from Twilio SendGrid To unsubscribe from Twilio SendGrid, select **Unsubscribe** from the Twilio SendGrid resource detail page. ![The Twilio SendGrid Azure resource with the "Unsubscribe" link highlighted]({{root_url}}/img/sg_azure_change_plan_unsubscribe.png 'Unsubscribe from Twilio SendGrid') A modal will open asking you to select the reason for ending your subscription. Select an option that best describes your situation, and click **Unsubscribe**. ![The Twilio SendGrid Azure resource Unsubscribe confirmation page]({{root_url}}/img/sg_azure_unsubscribe_modal.png 'Unsubscribe from Twilio SendGrid') You will receive a confirmation message when your subscription has been removed. ### Reactivate your Twilio SendGrid account If you have unsubscribed from Twilio SendGrid and need the service again in the future, you will need to create a new subscription. If your account has been suspended, you can reactivate the service by paying any outstanding account balance. Once payment has been received, you'll be able to reactivate your account. ================================================ FILE: content/docs/for-developers/partners/microsoft-azure.md ================================================ --- layout: page weight: 0 group: platform-partners title: Microsoft Azure navigation: show: true --- If you are using Microsoft’s cloud platform, you can easily integrate with SendGrid. Simply navigate to the [Azure Marketplace](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/SendGrid.SendGrid), locate the [SendGrid add-on](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/SendGrid.SendGrid), select the appropriate plan, and get ready to start sending. The following documentation covers signing up, sending an email, adding an attachment, as well as using filters. See the below Code Examples to start learning how Azure and SendGrid can solve your email deliverability problems. ## Code Examples 1. [PHP](https://docs.microsoft.com/en-us/azure/store-sendgrid-php-how-to-send-email) 2. [Node.js](https://docs.microsoft.com/en-us/azure/store-sendgrid-nodejs-how-to-send-email) 3. [.NET](https://docs.microsoft.com/en-us/azure/sendgrid-dotnet-how-to-send-email) 4. [Java](https://docs.microsoft.com/en-us/azure/store-sendgrid-java-how-to-send-email) 5. [Java]({{root_url}}/for-developers/partners/azure/) via an Azure webpage 6. [Mobile Services](https://docs.microsoft.com/en-us/azure/sendgrid-dotnet-how-to-send-email) ## Still have questions? Wondering how to make the most of your SendGrid/Azure integration? Check out our [Azure related blog entries](https://sendgrid.com/?s=Azure). You are limited to 1 SendGrid account per Azure subscription. This limit exists for security and compliance reasons to prevent abuse. Customers that integrate through the [Azure Marketplace](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/SendGrid.SendGrid), do not have access to SendGrid's Marketing Campaigns. If you try to create a second account, you will encounter this error on your dashboard: ![]({{root_url}}/images/azure_account_error.png) ================================================ FILE: content/docs/for-developers/sending-email/api-getting-started.md ================================================ --- seo: title: Getting started with the SendGrid API description: Sending your first email using the SendGrid REST API. keywords: Getting Started, API, v3, REST, SendGrid REST API title: Getting started with the SendGrid API group: api-v3 weight: 100 layout: page navigation: show: true --- There are several ways you can get started with the SendGrid API. ## Prerequisites for sending your first email with the SendGrid API These instructions describe how to send your first email using cURL calls. This is one of many ways to send email with the SendGrid API - we also have [PHP](https://github.com/sendgrid/sendgrid-php), [Python](https://github.com/sendgrid/sendgrid-python), [Node.js](https://github.com/sendgrid/sendgrid-nodejs), [Java](https://github.com/sendgrid/sendgrid-java), [C#](https://github.com/sendgrid/sendgrid-csharp), [Go](https://github.com/sendgrid/sendgrid-go), and [Ruby](https://github.com/sendgrid/sendgrid-ruby) libraries. Before you can start using the API, you need to do the following: 1. Create a SendGrid [account](https://sendgrid.com/pricing/). 2. Create an [API Key](https://app.sendgrid.com/settings/api_keys). 3. Make sure you have [curl](https://curl.haxx.se/) installed on your machine. <call-out> cURL comes standard on Mac operating systems. </call-out> ## How to send an API email ### Build your API call Your API call must have the following components: - **A host.** The host for Web API v3 requests is always `https://api.sendgrid.com/v3/` - **An [Authorization header](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authentication#authorization-header).** An [API Key](https://app.sendgrid.com/settings/api_keys) must be included in the Authorization header. - **A request.** When submitting data to a resource via POST or PUT, you must submit your payload in JSON. <call-out> **Message size limit:** The total message size should not exceed 20MB. This includes the message itself, headers, and the combined size of any attachments. </call-out> ### Send your email using the API <call-out type="warning"> Please note that Basic Authentication is no longer accepted; you must use an API key. </call-out> _To Send an email using the SendGrid API:_ ``` curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'Authorization: Bearer <<YOUR_API_KEY>>' \ --header 'Content-Type: application/json' \ --data '{"personalizations":[{"to":[{"email":"john.doe@example.com","name":"John Doe"}],"subject":"Hello, World!"}],"content": [{"type": "text/plain", "value": "Heya!"}],"from":{"email":"sam.smith@example.com","name":"Sam Smith"},"reply_to":{"email":"sam.smith@example.com","name":"Sam Smith"}}' ``` 1. Copy the curl example above. 2. Paste the curl call into your favorite text editor. 3. Copy your API key and paste it in the "Authorization" header. 4. In the data section, specify the "to", "from", and "reply to" names and email addresses and enter a subject. 5. Copy the code and paste it in your terminal. 6. Hit **Enter**. 7. Check the inbox of the address you specified as the "to" email and see your message! <call-out> If you have not yet set up [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) in your account, you may need to check your spam folder for the email you just sent. </call-out> <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ### API response messages All responses are returned in JSON format. We specify this by sending the `Content-Type` header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next steps For more information on SendGrid and where you can go from here, check out these pages: - [API Reference]({{root_url}}/api-reference/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Automating Subusers]({{root_url}}/for-developers/sending-email/automating-subusers/) ================================================ FILE: content/docs/for-developers/sending-email/applemail.md ================================================ --- layout: page weight: 0 title: Apple Mail group: plugins navigation: show: true --- These instructions show how to add an SMTP server to an existing Mail account, but you can also add these settings at the account creation stage. ## Adding SMTP settings Go to Mail -\> Preferences (⌘,). On the account you want to edit, click the tab that says **Server Settings**, then click the **Outgoing Mail Account** dropdown and select **Edit SMTP Server List...**. ![Mail, Preferences, Outgoing Mail Server (SMTP) dropdown, Edit SMTP Server List]({{root_url}}/images/NewAppleMail_Step_1.png "Edit SMTP Server List") Next, click the **+** under the list of SMTP servers, and add a new one. ![The plus button to click to add an SMTP server]({{root_url}}/images/NewAppleMail_Step_2.png "Add SMTP Server") Then enter the server details: - **Description:** SendGrid - **User Name:** SendGrid account username - **Password:** SendGrid account password - **Host Name:** smtp.sendgrid.net - Uncheck **Automatically manage connection settings** if you want to specify Custom Ports, Encryption Type and Authentication - **Port:** Specify the port - **Encryption:** Check or uncheck Use TLS/SSL - **Authentication:** Password ![Settings for Mail to use SendGrid SMTP]({{root_url}}/images/NewAppleMail_Step_3.png "SendGrid SMTP server settings") Now the SendGrid SMTP Server can be specified on the **Accounts** tab of the **Preferences** window in the **Outgoing Mail Account** dropdown. Once this is selected, mail sent out of Apple Mail going forward will use the SMTP server chosen until specified otherwise. ![The dropdown menu to select the SMTP server to use for this send.]({{root_url}}/images/NewAppleMail_Step_4.png "SMTP server dropdown") <call-out> Unfortunately, there is not an easy way to add SMTP API headers to a message in Mail. </call-out> ## Attachment Compatibility Mail will sometimes attach images in a way that is incompatible with other email readers. However, this behavior can be changed so that Mail will send more traditional non-inline attachments. 1. Open Terminal (found in Finder > Applications > Utilities). 1. In Terminal, paste the following: ```defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes```. 1. Press return. 1. Restart the Mail app. If you wish to restore the normal behavior of Mail, repeat the steps above while using the following command: ```defaults write com.apple.mail DisableInlineAttachmentViewing -bool no```. ================================================ FILE: content/docs/for-developers/sending-email/authentication.md ================================================ --- seo: title: Authentication description: Authenticating with the SendGrid API. keywords: getting started, Authentication, authorization, API key title: Authentication group: sending-email weight: 0 layout: page navigation: show: true --- SendGrid supports API keys delivered via Bearer token or Basic authentication, depending on the SendGrid functionality you are using. In addition to Bearer API key authentication, SendGrid recommends two-factor authentication (2FA) to improve security. ## API key Authenticate to the SendGrid API by creating an API Key in the [Settings section of the SendGrid UI](https://app.sendgrid.com/settings/api_keys). SendGrid requires using API keys because they are a secure way to talk to the SendGrid API that is separate from your username and password. If your API key gets compromised, it's easy to delete and create a new API key and update your environment variables with the new key. API key permissions can be set to provide access to different functions of your account, without providing access to your account as a whole. To use an API key, pass an Authorization header with a value of `Bearer <Your-API-Key-Here>`, where you replace `<Your-API-Key-Here>` with the API Key that you created in the UI. Example header: ``` GET https://api.sendgrid.com/v3/resource HTTP/1.1 Authorization: Bearer <Your-API-Key-Here> ``` ```bash curl -X "GET" "https://api.sendgrid.com/v3/templates" -H "Authorization: Bearer <Your-API-Key-Here>" -H "Content-Type: application/json" ``` ## Basic authentication SendGrid supports Basic Authentication using an API key as your password value for some services. When using Basic Authentication, your username will always be "apikey," and your password will be your API key. <call-out type="warning"> To ensure the security of your account, Twilio SendGrid has ended support for basic authentication with username and password as of Q4 2020. </call-out> ### Security with Basic authentication Using basic authentication with your account password is not as secure as using an API key. If your credentials are compromised—for example, if you accidentally commit them to version control—it is more difficult to regain the security of your account when those credentials are your username and password rather than an API key. For this reason, Twilio SendGrid no longer supports authentication via username and password. <call-out type="warning"> If you are currently using Basic authentication, we recommend upgrading your authentication method to Bearer using [API Keys]({{root_url}}/ui/account-and-settings/api-keys/) and then enabling Two-Factor Authentication for improved security. For more information, see [Upgrading your authentication method to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/). </call-out> ## Two-factor authentication Enabling two-factor authentication (2FA) will allow Twilio SendGrid to deliver confirmation codes via SMS to your mobile phone. You will not be able to log in when cellular service is not available. SMS 2FA is powered by [Authy](https://authy.com/). Selecting this option does not require an Authy account, but if you have one, you will be able to use either the [Authy App](https://www.authy.com/app/mobile/) or SMS messages. SendGrid recommends enabling two-factor authentication (2FA) for all users. For more information about setting up 2FA, see [Two-factor authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). <call-out> To ensure the security of your account, Twilio SendGrid requires customers to enable [Two-factor authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). </call-out> <call-out type="warning"> It is not possible to use basic authentication for users, subusers, or teammates that enable 2FA. </call-out> ================================================ FILE: content/docs/for-developers/sending-email/automating-subusers.md ================================================ --- seo: title: Automate Adding Subusers with the SendGrid API description: Use the SendGrid API to add Subusers to your account. keywords: Getting Started, API, v3, REST, SendGrid REST API, Subuser title: Automate Adding Subusers with the SendGrid API group: api-v3 weight: 100 layout: page navigation: show: true --- You can utilize the SendGrid API to automate the addition of Subusers to your account. Use the following ```curl``` examples to add a Subuser using the SendGrid V3.0 API. ## Prerequisites for automating addition of Subusers to your account Before you can start using the API, you need to do the following: 1. Create a SendGrid [account](https://sendgrid.com/pricing/). 2. Create an [API Key](https://app.sendgrid.com/settings/api_keys). 3. Make sure you have [curl](https://curl.haxx.se/) installed on your machine. <call-out> cURL comes standard on Mac operating systems. </call-out> ## How to add a Subuser via the SendGrid API and curl ### Creating the Subuser 1. **Create Subuser** - Creating the actual account, the profile, username, password, and the keys you want on the account. ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{ "username": “examplecurltesting", "email": "example@example.com", "password": “PASSWORD", "ips": [ "167.89.38.39", "198.37.152.144" ] }' 'https://api.sendgrid.com/v3/subusers' ``` The successful Response looks like this: ```bash => 2xx {"username”:”examplecurltesting","user_id":1868534,"email”:”example@example.com","signup_session_token":"","authorization_token":"","credit_allocation":{"type":"unlimited"}} ``` 2. **GET Subusers** (optional step to confirm POST): ```bash curl -X GET -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" 'https://api.sendgrid.com/v3/subusers' ``` Response: ```bash [{"disabled":false,"email":"example@example.com","id":1762958,"username":"exampletestingv3subuserapi"},{"disabled":false,"email":"example@testsite.com","id":1766771,"username":"examplesubuser-UI"},{"disabled":false,"email":"example@testsite.com","id":1803837,"username":"exampleisasubuser"},{"disabled":false,"email":"example@example.com","id":1868534,"username":"examplecurltesting"}] ``` 3. **Create API Keys** (optional, depends on integration style): If the application would rather run on API keys than a password, then follow this step: ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"name": “API KEY NAME"}' 'https://api.sendgrid.com/v3/api_keys' ``` or, you can create the key for your Subuser: ```bash curl -X POST -H "Authorization: Bearer PARENT_APIKEY_HERE" -H "On-Behalf-Of: examplecurltesting" \ -H "Content-Type: application/json" -d '{"name": “API KEY NAME"}' \ 'https://api.sendgrid.com/v3/api_keys' ``` Successful API key implementation Response: ```bash => 201 created {"api_key":"SG.XXXXXXXXXXXXXXXXXXXXXXXXX","api_key_id":"sample_id","name":"new api key","scope_set_id":"00766089-9730-4f16-8191-b8bedc5f57f5"} ``` Once this has been done, the Subuser has been created. From this point on, we’ll cover implementing Click Tracking, Open Tracking, and the Event Webhook for those Subusers. ### Enable/Edit Applications As of right, now this needs to be done directly through the account in question. **Click Tracking** ```bash curl -X PATCH -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"enabled": true,"enable_text" : true}' 'https://api.sendgrid.com/v3/tracking_settings/click' ``` Response: ```bash => 200 OK {"enable_text":true,"enabled":true} ``` **Open Tracking** ```bash curl -X PATCH -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"enabled": true}' 'https://api.sendgrid.com/v3/tracking_settings/open' ``` Response: ```bash => 200 ok {"enabled":true} ``` **Event Webhook** ```bash curl -X PATCH -H "Authorization: Basic XXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"enabled": true,"url":"https://api.keen.io/3.0/projects/526a8a5f05cd660472000012/partners/sendgrid?api_key=081da3fc30ca5b11b1f8b133de7064817b57c86d3261f140dc36243eb6829a100d4c5e38db8dd289194d4e02159bbf7ebad74a1fba1fce7a421a00c7a2f7d0f8ba5ef6ea3cece6345904d79395c35cdeaed221c3a208c897e79dd95da399a1d2d1d3e66768af929aa52d621e5bd296a5","group_resubscribe": true,"delivered": true,"group_unsubscribe": true,"bounce": true,"deferred": true,"unsubscribe": true,"processed": true,"open": true,"click": true,"dropped": true}' 'https://api.sendgrid.com/v3/user/webhooks/event/settings' ``` Response: ```bash => 200 ok { "bounce": true, "click": true, "deferred": true, "delivered": true, "dropped": true, "enabled": true, "group_resubscribe": true, "group_unsubscribe": true, "open": true, "processed": true, "spam_report": false, "unsubscribe": true, "url": "https://api.keen.io/3.0/projects/526a8a5f05cd660472000012/partners/sendgrid?api_key=081da3fc30ca5b11b1f8b133de7064817b57c86d3261f140dc36243eb6829a100d4c5e38db8dd289194d4e02159bbf7ebad74a1fba1fce7a421a00c7a2f7d0f8ba5ef6ea3cece6345904d79395c35cdeaed221c3a208c897e79dd95da399a1d2d1d3e66768af929aa52d621e5bd296a5"} ``` ### Domain Authentication for the Subuser Now we are going to setup Domain Authentication for the Subusers created above. This process involves creating the parent Domain Authentication and then associating it with your Subusers: 1. **Create Domain Authentication** ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{ "domain": "example.com", "subdomain": "subdomain", "ips": [ "167.89.38.39", "198.37.152.144" ], "default": true, "automatic_security": true }' 'https://api.sendgrid.com/v3/whitelabel/domains' ``` Response: ```bash => 2xx {"id":50784,"user_id":624781,"subdomain":"subdomain","domain":"example.com","username":"examplecurltesting","ips":["167.89.38.39","198.37.152.144"],"custom_spf":false,"default":true,"legacy":false,"automatic_security":true,"valid":false, "dns":{"mail_cname":{"valid":false,"type":"cname","host":"subdomain.example.com","data":"u624781.wl.sendgrid.net"},"dkim1":{"valid":false,"type":"cname","host":"s1._domainkey.example.com","data":"s1.domainkey.u624781.wl.sendgrid.net"},"dkim2":{"valid":false,"type":"cname","host":"s2._domainkey.example.com","data":"s2.domainkey.u624781.wl.sendgrid.net"},"spf":{"valid":false,"type":"txt","host":"example.com","data":"v=spf1 include:u624781.wl.sendgrid.net -all"}}} { "id": 50784, "user_id": 624781, "subdomain": "subdomain", "domain": "example.com", "username": "examplecurltesting", "ips": [ "167.89.38.39", "198.37.152.144" ], "custom_spf": false, "default": true, "legacy": false, "automatic_security": true, "valid": false, "dns": { "mail_cname": { "valid": false, "type": "cname", "host": "subdomain.example.com", "data": "u624781.wl.sendgrid.net" }, "dkim1": { "valid": false, "type": "cname", "host": "s1._domainkey.example.com", "data": "s1.domainkey.u624781.wl.sendgrid.net" }, "dkim2": { "valid": false, "type": "cname", "host": "s2._domainkey.example.com", "data": "s2.domainkey.u624781.wl.sendgrid.net" }, "spf": { "valid": false, "type": "txt", "host": "example.com", "data": "v=spf1 include:u624781.wl.sendgrid.net -all" } } ``` You will want to look for the Domain Authentication ID here (in this example, the ID is ```"id": 50784```), as this will be used in the next calls to append this ID to the Subusers. Also, the records needed to validate this Domain Authentication will be passed back in the response. 2. **Create Reverse DNS** ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXXX" -H "Content-Type: application/json” -d '{"ip": "167.89.66.50", "subdomain": "email", "domain": "example.com"}' 'https://api.sendgrid.com/v3/whitelabel/ips' ``` Successful Response: ```bash => 2xx { "id": 11887, "ip": "167.89.66.50", "rdns": "o4.email.example.com", "users": [], "subdomain": "email", "domain": "example.com", "a_record": { "valid": false, "type": "a", "host": "o4.email.example.com", "data": "167.89.66.50" }, "valid": false, "legacy": false } ``` 3. **Create Link Branding** ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{ "domain": "example.com", "subdomain": "links", "default": true }' 'https://api.sendgrid.com/v3/whitelabel/links' ``` Response: ```bash => 2xx { "id": 42371, "user_id": 624781, "domain": "example.com", "subdomain": "links", "username": "examplecurltesting", "valid": false, "default": true, "legacy": false, "dns": { "domain_cname": { "valid": false, "type": "cname", "host": "links.example.com", "data": "sendgrid.net" }, "owner_cname": { "valid": false, "type": "cname", "host": "624781.example.com", "data": "sendgrid.net" } } } ``` After creating DNS records then wait for them to propagate and validate records. 4. **GET all Domain Authentication IDs** - grab the ID to validate and associate to an account. ```bash curl -X GET -H "Authorization: Basic XXXXXXXXXXXXXXXX" -H "Content-Type: application/json" 'https://api.sendgrid.com/v3/whitelabel/domains' ``` Response: ```bash = 2xx ok { "id": 50784, "user_id": 624781, "subdomain": "subdomain", "domain": "example.com", "username": "examplecurltesting", "ips": [ "167.89.38.39", "198.37.152.144" ], "custom_spf": false, "default": true, "legacy": false, "automatic_security": true, "valid": false, "dns": { "mail_cname": { "valid": false, "type": "cname", "host": "subdomain.example.com", "data": "u624781.wl.sendgrid.net" }, "dkim1": { "valid": false, "type": "cname", "host": "s1._domainkey.example.com", "data": "s1.domainkey.u624781.wl.sendgrid.net" }, "dkim2": { "valid": false, "type": "cname", "host": "s2._domainkey.example.com", "data": "s2.domainkey.u624781.wl.sendgrid.net" }, "spf": { "valid": false, "type": "txt", "host": "example.com", "data": "v=spf1 include:u624781.wl.sendgrid.net -all" } } } ``` 5. **Validate ID of the Domain Authentication** Once you have the ID of the Domain Authentication you can Validate it. ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXXXX" -H "Content-Type: application/json" 'https://api.sendgrid.com/v3/whitelabel/domains/50784/validate' ```` Response: ```bash => 2xx { "id”: 50784, "valid": true, "validation_results": { "mail_cname": { "valid": false, "reason": "Expected your MX record to be "mx.sendgrid.net" but found "example.com"." },"dkim1": { "valid": true, "reason": null }, "dkim2": { "valid": true, "reason": null }, "spf": { "valid": true, "reason": null } } } ``` 6. **Associate with a Subuser** Once Validated, you can associate to any Subuser accounts. ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXXXXX" -H "Content-Type: application/json" -d '{ "username": "examplecurltesting" }' 'https://api.sendgrid.com/v3/whitelabel/domains/50784/subuser' ```` 7. **Link Branding** Follow the same process with Link branding: ```bash -> GET link ID (ex. 42371) curl -X GET -H "Authorization: Basic XXXXXXXXXXXXXX" -H "Content-Type: application/json" -'https://api.sendgrid.com/v3/whitelabel/links' ``` Response: ```bash => 200 ok [ { "id": 203, "user_id": 624781, "domain": "example.com", "subdomain": "links", "username": "examplecurltesting", "valid": true, "default": false, "legacy": false, "dns": { "domain_cname": { "valid": true, "type": "cname", "host": "links.example.com", "data": "sendgrid.net" }, "owner_cname": { "valid": true, "type": "cname", "host": "624781.example.com", "data": "sendgrid.net" } } }, { "id": 202, "user_id": 624781, "domain": "example.org", "subdomain": "links", "username": "examplecurltesting", "valid": true, "default": false, "legacy": false, "dns": { "domain_cname": { "valid": true, "type": "cname", "host": "links.example.org", "data": "sendgrid.net" }, "owner_cname": { "valid": true, "type": "cname", "host": "624781.example.org", "data": "sendgrid.net" } } }, { "id": 42371, "user_id": 624781, "domain": "example.net", "subdomain": "links", "username": "examplecurltesting", "valid": false, "default": true, "legacy": false, "dns": { "domain_cname": { "valid": false, "type": "cname", "host": "links.example.net", "data": "sendgrid.net" }, "owner_cname": { "valid": false, "type": "cname", "host": "624781.example.net", "data": "sendgrid.net" } } } ] ``` Validate Link Branding: ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXX" -H "Content-Type: application/json" 'https://api.sendgrid.com/v3/whitelabel/links/203/validate' ``` Response: ```bash => 200 ok { "id": 203, "valid": true, "validation_results": { "domain_cname": { "valid": true, "reason": null }, "owner_cname": { "valid": true, "reason": null } } } ``` Associate Link Branding: ```bash curl -X POST -H "Authorization: Basic XXXXXXXXXXXX" -H "Content-Type: application/json" -d '{"username": "jane@example.com”}' 'https://api.sendgrid.com/v3/whitelabel/links/{link_id}/subuser' ``` Response: ```bash => 201 created { "id": 200, "user_id": 623032, "domain": "example.com", "subdomain": "links", "username": "examplecurltesting", "valid": false, "default": false, "legacy": false, "dns": { "domain_cname": { "valid": false, "type": "cname", "host": "links.example.com", "data": "sendgrid.net" }, "owner_cname": { "valid": true, "type": "cname", "host": "623032.example.com", "data": "sendgrid.net"}}} ``` ## Next Steps For more information on SendGrid and where you can go from here, check out these pages: - [API Reference]({{root_url}}/api-reference/) - [How to Create a Subuser with the API]({{root_url}}/for-developers/sending-email/how-to-create-a-subuser-with-the-api/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to Send Email]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) ================================================ FILE: content/docs/for-developers/sending-email/brite-verify.md ================================================ --- seo: title: Using SendGrid with BriteVerify description: Verify your SendGrid email list with Briteverify keywords: SendGrid email list, SendGrid integrate, Briteverify, Tutorial title: Using SendGrid with BriteVerify group: plugins weight: 90 layout: page navigation: show: true --- ## Creating a new API Key Use BriteVerify to verify your SendGrid list. First, you will need to generate an API Key within SendGrid. <call-out type="warning"> Once you generate the SendGrid Key, copy the API Key somewhere safe for future reference—this will only be visible once. </call-out> <call-out> We hid API Keys in this tutorial for security purposes. </call-out> To get started, open the BriteVerify app and click **Verify New List** and then select **SendGrid**. ![]({{root_url}}/images/briteverify_verify_new_list.jpg) ![]({{root_url}}/images/briteverify_choose_list.jpg) The app triggers the prompt to input the SendGrid API key. The app requires this authentication only once to link the 2 applications. ![]({{root_url}}/images/briteverify_auth_sg.jpg) To generate the SendGrid API key, log into your SendGrid account. On the left side of the screen, click **Settings** and then click **API Keys**. ![]({{root_url}}/images/briteverify_navbar.jpg) On the API Keys page, click **Create API Key**. ![]({{root_url}}/images/briteverify_createapikey.jpg) Here you will be able to name your API Key and set up the relevant permissions. Select **Restricted Access** to customize permissions. ![]({{root_url}}/images/briteverify_create_api_key_sidebar.jpg) To allow BriteVerify to work with your SendGrid list, make the following changes to your permissions: - Email Activity – should have “read” access - Stats – should have “read” access - Suppressions – should have “full” access - Marketing Campaigns – should have “full” access ![]({{root_url}}/images/briteverify_access_levels.jpg) When finished, click **Create & View** to generate your API Key. <call-out type="warning"> Remember to store this key somewhere safe because you will not be able to retrieve or restore it once you navigate away from this page. </call-out> ![]({{root_url}}/images/briteverify_apikey_created.jpg) Copy the key then paste it in the textbox in the Briteverify app. Make sure that there are no extra spaces when pasting the key. If you enter the key incorrectly, an error requesting you to review the info displays. ![]({{root_url}}/images/briteverify_enter_api_key.jpg) Once you provide the correct API Key, the applications sync, and you may now verify your SendGrid data. Choose the list you would like to verify and an estimated cost will display. ![]({{root_url}}/images/briteverify_sgimport1.jpg) Risky emails include Unknown and Accept_all category emails. Remove these to prevent diluting a marketing campaign’s overall performance. Enable the radio button to eliminate risky emails from the final list. ![]({{root_url}}/images/briteverify_sgimport2.jpg) Next choose **File** as your Export Destination. Once the verification is complete, BriteVerify transfers the cleaned list directly to your SendGrid account. Click **Verify List** to begin the verification. ![]({{root_url}}/images/briteverify_sgimport3.jpg) <call-out> For more information or support, contact [BriteVerify](https://support.briteverify.com/) </call-out> ================================================ FILE: content/docs/for-developers/sending-email/building-an-x-smtpapi-header.md ================================================ --- seo: title: Building an X-SMTPAPI Header description: Learn how to build email content, add recipients and schedule your send. keywords: SMTP, send email, integrate, building, filters, scheduling, substitution, suppression groups, unique arguments, recipients, X-SMTPAPI title: Building an X-SMTPAPI Header group: smtp weight: 949 layout: page navigation: show: true --- Now that you've [sent a test SMTP email with Telnet]({{root_url}}/for-developers/sending-email/getting-started-smtp/), and [integrated with SendGrid]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/), it's time to build content. ## Getting started building The Twilio SendGrid SMTP service allows you to pass SendGrid a JSON string with as many SMTP objects as you want. This functionality is made possible by including a header named X-SMTPAPI. This page provides instructions for using the X-SMTPAPI to modify and control your mail send. ### Limitations The X-SMTPAPI is a powerful way to modify your SMTP messages. However, there are several things to keep in mind when using the header. - Ensure that you are sending just ONE X-SMTPAPI header per SMTP transaction. For any request received with multiple X-SMTPAPI headers on the same request, Twilio SendGrid will adhere to the first X-SMTPAPI header instance on each request. - There is a hard limit of 10,000 addresses in a multiple recipient email. However, the best practice is to split large jobs into separate transactions of approximately 1,000 recipients, which allows better processing load distribution. If you have a large number of additional substitutions or sections in the headers, it is best to split the send into even smaller groups. - When using the X-SMTPAPI header to send to multiple recipients, you cannot use SMTP's standard RCPT TO command to also send to multiple recipients. Doing so can generate duplicate messages to the addresses listed in both the X-SMTPAPI "to" field and the RCPT list. For more information, see [RFC 5321](https://tools.ietf.org/html/rfc5321). - Ensure that the header is limited to a maximum total line length of 1,000 characters. Failure to do this can cause intermediate Mail Transfer Agents (MTAs) to split the header on non-space boundaries, which causes inserted spaces in the final email. If your email is going through another MTA before reaching SendGrid, it is likely that the other MTA will have an even lower setting for maximum header length and may truncate the header. - When using the X-SMTPAPI header, if our system encounters a parsing error, the message will be bounced to the address specified in the MAIL FROM portion of the SMTP session. The MAIL FROM address is re-written when we send the email for final delivery, so it is safe to set the MAIL FROM to an address that can receive the bounces and alert you to any errors. - When sending Unicode characters via the SMTP API, you should escape these characters using the `\u` escape character. For example, the Unicode `á` character will look like this: `\u00E1`. ## Customizing your send (filters) ```json { "to": ["example@example.com", "example@example.com"], "sub": { "%name%": ["Ben", "Joe"], "%role%": ["%sellerSection%", "%buyerSection%"] }, "category": ["Orders"], "unique_args": { "orderNumber": "12345", "eventID": "6789" }, "filters": { "footer": { "settings": { "enable": 1, "text/plain": "Thank you for your business" } } }, "send_at": 1409348513 } ``` You can customize the emails you send via SMTP by using different settings (also referred to as [filters](#smtp-filters)). The X-SMTPAPI header is a JSON-encoded object (key-value pairs) consisting of several sections. Below are examples of JSON strings using each section. - [Scheduling Your Send](#scheduling-your-send) - [BCC Behavior](#bcc-behavior) - [Substitution Tags](#substitution-tags) - [Suppression Groups](#suppression-groups) - [Categories](#categories) - [Unique Arguments](#unique-arguments) - [SMTP Filters](#smtp-filters) - [IP Pools](#ip-pools) ### Scheduling Your Send Schedule your email send time using the `send_at` parameter within your X-SMTPAPI header. Set the value of `send_at` formatted as a [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time). ```json { "send_at": 1409348513 } ``` For more information, see our [scheduling parameters documentation]({{root_url}}/for-developers/sending-email/scheduling-parameters/). ### BCC behavior It is possible to simulate blind carbon copy (BCC) behavior using SMTP with or without the X-SMTPAPI header. The concept of BCC exists outside of SMTP as defined by [RFC 5321](https://tools.ietf.org/html/rfc5321). When sending email with SMTP, all recipients are listed using SMTP's RCPT (recipient) command. In addition to the sender, which is set with SMTP's MAIL command, these RCPT addresses can be thought of as part of the message envelope—they instruct sending email servers where to deliver the message. These addresses are not designated as carbon copy (CC), BCC, or another type of recipient—they are all just recipients. The SMTP DATA command follows the MAIL and RCPT commands in an SMTP transaction. The DATA command allows you to insert message headers, which can be thought of as portions of the email body or the text inside the _envelope_. The DATA command is what allows you to create BCC behavior using SMTP without the X-SMTPAPI. #### BCC without the X-SMTPAPI header The following code shows an example of an SMTP transaction with BCC behavior. How this example achieves BCC behavior is explained following the example. ```shell 235 Authentication successful MAIL FROM:tiramisu@example.com 250 Sender address accepted RCPT TO:person1@sendgrid.com 250 Recipient address accepted RCPT TO:person2@sendgrid.com 250 Recipient address accepted DATA 354 Continue From: "Tira Misu" <tiramisu@example.com> To: <person1@sendgrid.com> Subject: Test message subject This is the test message body. . 250 Ok: queued as Yo60h6C5ScGPeP5fUWU3Kw ``` Notice that there are two recipients designated by RCPT commands, "person1@sendgrid.com" and "person2@sendgrid.com." These addresses are both part of the message envelope. In the DATA command, there is also a "To" header. This header lists only "person1@sendgrid.com." This is where differentiating between the envelop "To" (RCPT TO) and header "To" becomes important. The header "To" set in the DATA command does not tell the sending email server to deliver the message to any address, only the RCPT or envelop "To" does this. The header "To" instead provides recipients with a friendly display of any addresses included in the "To" header. To achieve BCC behavior, you can deliver a message to a recipient by adding them in a RCPT but omit their address from the header "To". The message will be delivered to each RCPT address, but only the addresses listed in the header "To" will be visible to other recipients. In the previous code sample, "person2@sendgrid.com" will be treated like a BCC address because that address is not included in the header "To." The "person1@sendgrid.com" is listed in the header "To" and will therefore be visible to other recipients of the message. This means both recipients receive the message, but recipient2@sendgrid.com is not visible to recipient1@sendgrid.com while recipient1@sendgrid.com is visible to recipient2@sendgrid.com. By omitting any addresses from the header "To," you will be hiding them from the other recipients and therefore treating them like BCC recipients. #### BCC with the X-SMTPAPI The following code shows an example of an SMTP transaction with BCC behavior using the X-SMTPAPI header. How this example achieves BCC behavior is explained following the example. ```shell 235 Authentication successful MAIL FROM:tiramisu@example.com 250 Sender address accepted RCPT TO:sender@sendgrid.com 250 Recipient address accepted DATA 354 Continue x-smtpapi: {"to":["person1@sendgrid.com","person2@sendgrid.com"]} From: "Tira Misu" <tiramisu@example.com> Subject: This is a test Body of test message. . 250 Ok: queued as uKIPst3rQtCl_hLVB9RvEw ``` Using the X-SMTPAPI header achieves BCC behavior in a slightly different way than by omitting addresses from a "To" header. The X-SMTPAPI header's "to" field allows you to set multiple recipients in a JSON array. ```json { "to": ["person1@sendgrid.com", "person2@sendgrid.com"] } ``` When SendGrid receives the message and parses the X-SMTPAPI header, it will treat each recipient address in the X-SMTPAPI "to" field as a separate RCTP TO or _envelope_ address. This means each recipient will receive the same DATA content, but with an added friendly display "to" header set to its own address. A single recipient in the X-SMTPAPI "to" field in the previous code sample will eventually look something like the following example. ```shell 235 Authentication successful MAIL FROM:test@example.com 250 Sender address accepted RCPT TO:person1@sendgrid.com 250 Recipient address accepted ``` The addresses in the X-SMTPAPI "to" field are not duplicated in a header "To," for all recipients. Only the individual recipient is included in the header "To" for each messages (Each recipient sees only their own address). The additional recipients will therefore not be visible to each recipient of the message. ### Substitution Tags Substitution tags allow you to dynamically insert specific content relevant to each of your recipients, such as their first and last names. For example, to use a substitution tag to replace the first name of your recipient, insert the tag {{name}} in the HTML of your message: ```html <html> <head></head> <body> <p> Hello {{name}},<br /> The body of your email would go here... </p> </body> </html> ``` To define the value that will replace the {{name}} tag, define the following in your X-SMTPAPI header: ```json { "to": ["john.doe@example.com", "jan.doe@example.com"], "sub": { "{{name}}": ["John", "Jane"] } } ``` For more information, see our [substitution tags documentation]({{root_url}}/for-developers/sending-email/substitution-tags/). ### Section Tags <call-out type="warning"> This feature has been deprecated. </call-out> Section tags are similar to substitution tags, but rather than replace tags with content for each recipient; section tags allow you to replace a tag with more generic content— like a salutation. For more information, see our [section tags documentation]({{root_url}}/for-developers/sending-email/section-tags/). ### Suppression Groups You can easily specify an unsubscribe group for an email sent via SMTP by including the `asm_group_id` parameter in your X-SMTPAPI header. Simply set the value of `asm_group_id` to the numerical ID of the group you would like to use. ```json { "asm_group_id": 1 } ``` For more information, see our [suppression groups documentation]({{root_url}}/for-developers/sending-email/suppressions/). ### Categories <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Categories allow you to track your emails according to broad topics that you define, like "Weekly Newsletter" or "Confirmation Email". Simply define the category by using the `category` parameter within your X-SMTPAPI header: ```json { "category": "Example Category" } ``` For more information, see our [categories documentation]({{root_url}}/for-developers/sending-email/categories/). <call-out> Categories should only be used for broad topics. To attach unique identifiers, please use [unique arguments]({{root_url}}/for-developers/sending-email/unique-arguments/). </call-out> ### Unique Arguments <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Use unique arguments to track your emails based on specific identifiers unique to individual messages. Unique arguments can be retrieved via SendGrid's [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) or your [email activity page]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/). For more information, see our [unique arguments documentation]({{root_url}}/for-developers/sending-email/unique-arguments/). ### SMTP Filters SMTP Filters can be used for turning on or off a number of different features for your sending. For example, you can turn on open or click tracking on a per-send basis. For more information, see our [SMTP Filters documentation]({{root_url}}/for-developers/sending-email/smtp-filters/). ### IP Pools IP Pools can be used to send you mail over a specific group of IPs. It is common to create different pools for transactional and marketing email. For more information, see our [IP Pools documentation](https://sendgrid.api-docs.io/v3.0/ip-pools). ```json { "ip_pool": "pool_name" } ``` ## Additional Resources - [How to send email]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [Getting started with the API]({{root_url}}/api-reference/) - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) ================================================ FILE: content/docs/for-developers/sending-email/cakephp.md ================================================ --- layout: page weight: 0 group: frameworks title: CakePHP seo: title: Send Email with CakePHP & SendGrid description: View instructions on how to easily send email with CakePHP using SendGrid, by setting up your views and controller. navigation: show: true --- CakePHP comes with an email library that already supports SMTP. [For more information check out the CakePHP documentation page](http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#configuration). This example shows how to send an email with both HTML and text bodies. In **app/views/layouts/** you need to define the layout of your text and HTML emails: ``` email/ html/ default.ctp text/ default.ctp ``` In **app/views/layouts/email/text/default.ctp** add: ``` php <!--?php echo $content_for_layout; ?--> ``` and in **app/views/layouts/email/html/default.ctp** add: ``` php <!--?php echo $content_for_layout; ?--> ``` Then create the template for your emails. In this example we created templates for a registration email with the following structure: ``` app/ views/ elements/ email/ text/ registration.ctp html/ registration.ctp ``` In **app/views/elements/email/text/registration.ctp** add: ``` php Dear <!--?php echo $name ?-->, Thank you for registering. Please go to http://domain.com to finish your registration. ``` and in **app/views/layouts/email/html/default.ctp** add: ``` php Dear <!--?php echo $name ?-->, Thank you for registering. Please go to <a href="http://domain.com">here</a> to finish your registration. ``` In your controller enable the email component: ``` php <!--?php var $components = array('Email'); ?--> ``` Then anywhere in your controller you can do something like the following to send an email: (make sure to replace your own sendgrid_username / sendgrid_api_key details, better to make them constant) ``` php <?php $this->Email->smtpOptions = array( 'port'=>'587', 'timeout'=>'30', 'host' => 'smtp.sendgrid.net', 'username'=>'sendgrid_username', 'api_key'=>'sendgrid_api_key', 'client' => 'yourdomain.com' ); $this->Email->delivery = 'smtp'; $this->Email->from = 'Your Name '; $this->Email->to = 'Recipient Name '; $this->set('name', 'Recipient Name'); $this->Email->subject = 'This is a subject'; $this->Email->template = 'registration'; $this->Email->sendAs = 'both'; $this->Email->send(); ?> ``` ================================================ FILE: content/docs/for-developers/sending-email/categories.md ================================================ --- layout: page weight: 0 title: Categories group: x-smtpapi navigation: show: true --- <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> You can add [categories]({{root_url}}/glossary/categories/) to the X-SMTPAPI header of the emails you send via SendGrid. This will allow you to track emails based on your own categorization system. <call-out type="warning"> Categories must be in 7bit encoding using the US-ASCII character set. </call-out> <call-out> Currently, there is no limit to the number of categories you can track. However, we recommend _no more than ~100 total unique categories_ as this will increase your ease of use in the Statistics area. Additionally, a high rate of unique categories on your account can negatively impact the rate at which we process the messages you send. </call-out> ## Example You can use SendGrid's [SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) to add these categories to your email. The following should be added to the email's header: <call-out type="warning"> When passing `category` please make sure to only use strings as shown in our examples. Any other type could result in unintended behavior. </call-out> ### Example Category Header ```json { "category": "Example Category" } ``` In this example, SendGrid would associate statistics for the email containing that header with the category **Example Category**. ## Limitations You can assign up to 10 categories per message: ```json { "category": ["dogs", "animals", "pets", "mammals"] } ``` <call-out type="warning"> Categories should be used to group messages together by broad topic. If you need to attach unique data or identifiers to a message, use [Unique Arguments]({{root_url}}/for-developers/sending-email/unique-arguments/) instead. </call-out> ================================================ FILE: content/docs/for-developers/sending-email/cloud-rail.md ================================================ --- layout: page weight: 0 title: Using CloudRail to integrate SendGrid into your application group: plugins navigation: show: true --- CloudRail is an API integration platform that has a set of free software libraries which abstract multiple external APIs from different providers, SendGrid among them, into a single and universal interface. This makes it easy to integrate many of them in your application. Abstract means that, for example, upload() works in exactly the same way for Dropbox as it does for Google Drive, OneDrive, and other Cloud Storage Services, and getEmail() works similarly the same way across all social networks. In this tutorial, the integration of the Android SDK into an application is demonstrated with Android Java code. Gradle is used as the build tool (Android Studio standard). Head to the [Website](https://cloudrail.com/) for all the details about CloudRail and instructions for other platforms. ## Setup The easiest way to integrate CloudRail for Android is via Maven. It suffices to add the following to your build.gradle: ```java dependencies { compile 'com.cloudrail:cloudrail-si-android:2.6.5' } ``` ## Send a simple email After setup, sending an email with SendGrid is a breeze. Just add code like the one below: ```java final Email email = new SendGrid(this, "[API key]"); new Thread() { public void run() { email.sendEmail( "[senderEmail]", "[senderName]", Arrays.asList("[toEmail]"), "I'm the subject", "I'm a text body", "<p>I'm an HTML body</p>", Arrays.asList("[ccAddress0]", "[ccAddress1]"), Arrays.asList("[bccAddress]") ); } }.start(); ``` ## Send a personalized email Since you've already integrated CloudRail SI, why not make use of some of the other APIs that come with it? Let's use Facebook to get a user's info to personalize the email: ```java final Email email = new SendGrid(this, "[API key]"); final Profile profile = new Facebook(this, "[Client ID]", "[Client Secret]"); new Thread() { public void run() { String userFullName = profile.getFullName(); // Implicitly triggers login String userEmail = profile.getEmail(); email.sendEmail( "[senderEmail]", "[senderName]", Arrays.asList(userEmail), "Hello " + userFullName + ", I'm the subject", "I'm a text body", "<p>I'm an HTML body</p>", Arrays.asList("[ccAddress0]", "[ccAddress1]"), Arrays.asList("[bccAddress]") ); } }.start(); ``` The code above assumes that "this" points to a Context (an Activity, for example, is a Context) and that you are registered as a developer with the services used (and thus possess the needed credentials). You can find more information about the functionalities and the services in the [Documentation](https://github.com/CloudRail/cloudrail-si-android-sdk/wiki). ================================================ FILE: content/docs/for-developers/sending-email/codeigniter.md ================================================ --- layout: page weight: 0 group: frameworks title: CodeIgniter seo: title: Send Email with CodeIgniter & SendGrid description: View instructions on how to easily send email with CodeIgniter using SendGrid, by setting up setting up CodeIgniter's built in mail library. navigation: show: true --- CodeIgniter comes with an email sending library built in. See more information on how to [use CodeIgniter with SendGrid](https://www.codeigniter.com/user_guide/libraries/email.html#using-the-email-library). <call-out> It is important to use the correct end of lines using "crlf" =\> "\\r\\n" and "newline" =\> "\\r\\n". </call-out> ``` php <?php $this->load->library('email'); $this->email->initialize(array( 'protocol' => 'smtp', 'smtp_host' => 'smtp.sendgrid.net', 'smtp_user' => 'apikey', 'smtp_pass' => 'sendgridapikey', 'smtp_port' => 587, 'crlf' => "\r\n", 'newline' => "\r\n" )); $this->email->from('your@example.com', 'Your Name'); $this->email->to('someoneexampexample@example.com'); $this->email->cc('another@another-example.com'); $this->email->bcc('them@their-example.com'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); $this->email->send(); echo $this->email->print_debugger(); ?> ``` ================================================ FILE: content/docs/for-developers/sending-email/cors.md ================================================ --- layout: page weight: 0 title: Cross Origin Resource Sharing (CORS) group: api-v3 navigation: show: true seo: title: Cross Origin Resource Sharing (CORS) description: CORS is a security feature of modern browsers to keep browser users secure. keywords: API, API Key, CORS, cross origin resource sharing --- Cross-Origin Resource Sharing is a security feature of modern browsers that keeps browser users secure. It prevents malicious activity like cross-site scripting. CORS implements headers in the response of any request to the server to say what domains are allowed to make specific types of calls to that server. In SendGrid's case, we do not allow our customers to make a browser-based call to our v3/mail/send endpoint. ## Browser-Only Applications When you have a browser-only application that reaches out to APIs, the API key has to be embedded in the application. Anyone with access to a browser-only application can access all of the Javascript source code, including your API keys. Making your API key publicly accessible could result in anyone authenticating API calls with your API key — this is a significant security concern both for you and SendGrid. ## Workarounds You can create a server-based application, which will protect your API keys from being released to the world. Languages like [NodeJS](https://github.com/sendgrid/sendgrid-nodejs), [PHP](https://github.com/sendgrid/sendgrid-php), [Ruby](https://github.com/sendgrid/sendgrid-ruby), [Python](https://github.com/sendgrid/sendgrid-python), [C#](https://github.com/sendgrid/sendgrid-csharp), [Go](https://github.com/sendgrid/sendgrid-go), and [Java](https://github.com/sendgrid/sendgrid-java), and others can be implemented to make calls to the API from the security of a locked down server environment. ================================================ FILE: content/docs/for-developers/sending-email/curl-examples.md ================================================ --- seo: title: cURL Examples for Common Use Cases description: keywords: cURL, v3 mail send title: cURL Examples for Common Use Cases group: api-v3 weight: 0 layout: page navigation: show: true --- Below are some cURL examples for several basic use cases to get you sending email through SendGrid's v3 Mail Send endpoint right away! ## Hello, World! ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'Authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}' ``` ## Sending a Basic Email to Multiple Recipients ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}],"cc": [{"email":"recipient2@example.com"}, {"email": "recipient3@example.com"}, {"email":"recipient4@example.com"}]}], "from": {"email": "sendeexampexample@example.com"},"subject":"Hello, World!", "content": [{"type": "text/plain", "value": "Heya!"}]}' ``` ## Sending a Basic Email Using a Template ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject":"Hello, World!","content": [{"type": "text/plain","value": "Heya!"}], "template_id" : "YOUR_TEMPLATE_ID"}' ``` ## Sending a Basic Email with Attachment ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sender@example.com"},"subject":"Hello, World!","content": [{"type": "text/html","value": "Hey,<br>Please find attachment."}], "attachments": [{"content": "BASE64_ENCODED_CONTENT", "type": "text/plain", "filename": "attachment.txt"}]}' ``` ## Sending a Basic Email at a Scheduled Time ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject":"Hello, World!","content": [{"type": "text/plain","value": "Heya!"}], "send_at" : UNIX_TIMESTAMP_HERE}' ``` ## Scheduling and Cancelling an Email You may schedule an email to be sent up to 72 hours in the future by using the `send_at` parameter. You may cancel this same scheduled email by using the [Cancel Scheduled Sends endpoint](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends). **Step 1: Generate a batch ID** ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/batch \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ ``` **Step 2: Schedule the email to be sent, using your new batch ID** ```bash curl --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject":"Hello, World!","content": [{"type": "text/plain","value": "Heya!"}], "send_at" : UNIX_TIMESTAMP_HERE, "batch_id" : "YOUR_BATCH_ID"}' ``` **Step 3: Cancel the scheduled email** ```bash curl --request POST \ --url https://api.sendgrid.com/v3/user/scheduled_sends \ --header 'authorization: Bearer YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{"batch_id":"YOUR_BATCH_ID","status":"cancel"}' ``` ================================================ FILE: content/docs/for-developers/sending-email/django.md ================================================ --- layout: page weight: 0 group: frameworks title: Django seo: title: Send SMTP Email with Django description: View instructions on how to easily send email with Django using SendGrid, by setting up setting up Django's built in mail library. navigation: show: true --- There is more detailed information about sending email over SMTP with Django on the [Django project website](https://docs.djangoproject.com/en/dev/topics/email/). First start by adding the following to **settings.py:** ```python SENDGRID_API_KEY = os.getenv('SENDGRID_API_KEY') EMAIL_HOST = 'smtp.sendgrid.net' EMAIL_HOST_USER = 'apikey' # this is exactly the value 'apikey' EMAIL_HOST_PASSWORD = SENDGRID_API_KEY EMAIL_PORT = 587 EMAIL_USE_TLS = True ``` Then to send email you can do the following: Inside yourapp.views.py ```python from django.core.mail import send_mail send_mail('Subject here', 'Here is the message.', 'from@example.com', ['to@example.com'], fail_silently=False) ``` <call-out> You may also send emails with Django by using the [django-sendgrid-v5](https://github.com/sklarsa/django-sendgrid-v5) library, which utilizes the [Web API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) instead of SMTP as the transport mechanism. </call-out> ================================================ FILE: content/docs/for-developers/sending-email/drupal.md ================================================ --- layout: page weight: 0 title: Drupal group: plugins navigation: show: true --- To send emails from Drupal using SendGrid, you may use the SendGrid Integration module, the SMTP Authentication Support module, the Swift Mailer module, or the PHPMailer SMTP Module depending on your needs. ## Using the SendGrid Integration Module The SendGrid Integration Module uses the SendGrid API web services to send email. It does not use SMTP. Depending on the workload of your website, this could be of benefit to you in performance. This module also provides charts for reports of vital statistics. The module does require an advanced knowledge of Drupal in order to install and setup. Usage of Drush is required. Download and install the [SendGrid Integration Module](https://www.drupal.org/project/sendgrid_integration "SendGrid Integration Module") from Drupal.org and perform updates via Drush with Composer Manager. Once installed access `admin/config/services/sendgrid` to configure your API credentials. For detailed instructions, please refer to the [module documentation](http://cgit.drupalcode.org/sendgrid_integration/tree/README.md). ## Using the SMTP Authentication Support Module To use SendGrid with [Drupal](https://www.drupal.org/ "Drupal"), use the [SMTP Authentication Support module](https://www.drupal.org/project/smtp "SMTP Authentication Support"). Install a version of this module that is compatible with your version of Drupal. ![]({{root_url}}/images/drupal_1.png "SMTP Module") Open your modules page, find the SMTP module, and configure it with the following settings: - **SMTP Server** - smtp.sendgrid.net - **SMTP Port** - 587 - **Use Encrypted Protocol** - No. If you want encryption choose "Use SSL" and set SMTP Port to 465 - **Username** - SendGrid Username: "apikey" - **Password** - SendGrid API Key ![]({{root_url}}/images/drupal_2.png "SMTP Module Configuration") ## Using the Swift Mailer Module To use the [Swift Mailer module](https://www.drupal.org/project/swiftmailer "Swift Mailer Module"), install a version of this module that is compatible with your version of Drupal. Configuration for this module is largely the same as above. ![]({{root_url}}/images/drupal_3.png "SMTP Module Configuration") ## Using the PHPMailer SMTP Module PHPMailer SMTP sends email via SMTP using the latest PHPMailer library and is RFC-compliant. It requires the [Mail System](https://www.drupal.org/project/mailsystem "Mail System") module. See the [project page](https://www.drupal.org/project/phpmailer_smtp "PHPMailer SMTP") for more details. Install using composer and enable. `composer require drupal/phpmailer_smtp` Once installed access `admin/config/system/phpmailer-smtp` to configure the module. - **Primary SMTP server** - smtp.sendgrid.net - **SMTP port** - 587 - **Use Secure Protocol** - TLS Under **SMTP Authentication**, set your username and password (API key): - **Username** - SendGrid Username: "apikey" - **Password** - SendGrid API Key ================================================ FILE: content/docs/for-developers/sending-email/enforced-tls.md ================================================ --- layout: page weight: 0 title: Enforced TLS group: sending-email navigation: show: true --- The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. The Enforced TLS endpoint supports retrieving and updating TLS settings. <call-out type="warning"> If either `require_tls` or `require_valid_cert` is set to `true`, the recipient must support TLS 1.1 or higher or have a valid certificate. If these conditions are not met, we drop the message and send a block event with “TLS required but not supported” as the description. </call-out> ## GET Get the current Enforced TLS settings. #### Request URL `GET https://api.sendgrid.com/v3/user/settings/enforced_tls HTTP/1.1` #### Response ```javascript HTTP/1.1 200 { "require_tls": true, "require_valid_cert": false } ``` ## PATCH Change the Enforced TLS settings <table class="table" style="table-layout:fixed"> <thead> <tr> <th> URI Parameter </th> <th> Required </th> <th> Requirements </th> <th> Description </th> </tr> <tr> <td> require_tls </td> <td> False </td> <td> true or false </td> <td> Require recipient TLS support </td> </tr> <tr> <td> require_valid_cert </td> <td> False </td> <td> true or false </td> <td> Require certificates to be valid </td> </tr> </thead> </table> #### Request URL `PATCH https://api.sendgrid.com/v3/user/settings/enforced_tls HTTP/1.1` #### Request Body ```javascript { "require_tls": true } ``` #### Response ```javascript HTTP/1.1 200 { "require_tls": true, "require_valid_cert": false } ``` ================================================ FILE: content/docs/for-developers/sending-email/exchange-2010.md ================================================ --- layout: page weight: 0 title: Exchange 2010 group: mail-servers navigation: show: true --- If your organization is using Microsoft's Exchange 2010 for email services, this document outlines the basics required in order to use SendGrid for SMTP. This requires the configuration of a send connector in the Exchange Management Console. <call-out type="warning"> This documentation assumes that you already have a working installation of Exchange 2010 that is configured for client access and is able to send messages to the public internet. **If you do not configure this connector correctly it may result in the unintended delivery of messages through your SendGrid account, resulting in the consumption of account emails.** </call-out> <call-out> [For more information regarding Send Connectors, check out this swank TechNet documentation on the subject](http://technet.microsoft.com/en-us/library/aa998662.aspx). </call-out> The configuration of a new send connector is straightforward. It is the associated configurations that you may require in order to properly control access to the connector that may be complicated. Let's start with just sending email through SendGrid: 1. Log in to your Exchange server or a server that has the Exchange Management Console installed for administrative purposes. 2. Go to **Start \> All Programs \> Microsoft Exchange Server 2010** and click on the **Exchange Management Console** item. 3. Roll open the **Organization Configuration** list and select **Hub Transport**. 4. Click on **New Send Connector** in the Actions sidebar. 5. Name the Send Connector whatever you like and select Internet for the Intended Use pull-down. This allows for the integration with an authenticated SmartHost and adds the default send permissions required by Exchange 2010 to route messages through an external host that is not a part of the domain forest. 6. Click **Next**. 7. Click Add and specify the allowed address space to which the connector can send messages. If you want to send to anyone on the internet, then you would insert a "\*" in the Address field. If you want to send only to a specific domain, enter that domain. If you want to allow all sub-domains you can check the box, but I prefer to notate that literally like so: \*.SAMPLEDOMAIN.COM. Insert a high cost (100 is the top, so choose wisely) so that the connector is not used inadvertently. 8. Click **Next**. 9. On the Network Settings page, select the **Route mail through the following smart hosts** item. 10. Click **Add**. 11. Select the **Fully qualified domain name (FQDN)** item, and enter: *smtp.sendgrid.net* 12. Click **Next**. 13. In the **Configure smart host authentication settings** page, select the **Basic Authentication** option and check the **Basic Authentication over TLS** checkbox. 14. Enter `apikey` as your username and your SendGrid [API key]({{root_url}}/ui/account-and-settings/api-keys/) as the password to authenticate. 15. Click **Next**. 15. If you only have one Exchange server, it should automatically appear. If you want to use another server(s) in your domain click Add to locate the servers you want to allocate to this connector. 16. Click **Next**. 17. Verify your settings and, when satisfied, click **New**. 18. If the configuration completes correctly, you will receive positive notification. You can then click on **Finish**. Once you have completed installation of the connector, you will need to configure your server(s) to allow limited access to the new send connector. You can read more about [Send Connector permissions][send-connector-permissions]. [send-connector-permissions]: https://docs.microsoft.com/en-us/previous-versions/office/exchange-server-2010/aa998662(v=exchg.141)#send-connector-permissions ================================================ FILE: content/docs/for-developers/sending-email/exim.md ================================================ --- layout: page weight: 0 title: Exim 4 group: mail-servers navigation: show: true seo: title: Exim 4 configuration for SendGrid keywords: Exim Internet Mailer, Exim, Exim, and SendGrid description: Configuration information for Exim 4 and SendGrid. --- <call-out type="warning"> Versions of Exim prior to the current major release are considered obsolete. If you are using Exim 3.x or earlier it is suggested by the Exim development team that you upgrade to the current release. </call-out> The following configuration file, which can be found at **/etc/exim4/update-exim4.conf.conf**, was pulled from Ubuntu Server 10.4 and is for example purposes only: ```bash dc_eximconfig_configtype='smarthost' dc_other_hostnames='' dc_local_interfaces='127.0.0.1' dc_readhost='your.server.name' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='smtp.sendgrid.net::587' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='true' dc_mailname_in_oh='true' ``` Enable TLS support in **/etc/exim4/exim4.conf.localmacros**. <call-out> If this file does not exist, you will need to create it: </call-out> ```bash MAIN_TLS_ENABLE = 1 ``` Enter credentials that will allow Exim to access SendGrid in **/etc/exim4/passwd.client**: <call-out> Note that you must use an API key to authenticate. Do this by setting your username to 'apikey' and your password to your API key's actual value (the string provided by Twilio SendGrid when you created the key). </call-out> ```bash *:apikey:<YourAPIKey> ``` Once you have completed and saved all changes to Exim's configuration files, you will need to restart it to activate those changes: ```bash $ /etc/init.d/exim4 restart ``` ## cPanel If you are using cPanel with Exim and want to relay your email through SendGrid, go to **Main \> Service Configuration \> Exim Configuration Editor**, click on the Advanced Editor button, and enter the following in the **AUTH** Box: ```bash begin authenticators sendgrid_login: driver = plaintext public_name = LOGIN client_send = : apikey : <YourAPIKey> ``` <call-out> Only include "begin authenticators" if it's not already in the configuration. </call-out> Add a route in the **Router Configuration** Box: ```bash send_via_sendgrid: driver = manualroute domains = ! +local_domains transport = sendgrid_smtp route_list = "* smtp.sendgrid.net::587 byname" host_find_failed = defer no_more ``` Add a transport to the **Transport Configuration** Box: ```bash sendgrid_smtp: driver = smtp hosts = smtp.sendgrid.net hosts_require_auth = <; $host_address hosts_require_tls = <; $host_address ``` Once you have completed and saved all changes to Exim's configuration files, you will need to restart it to activate those changes: ```bash $ /etc/init.d/exim4 restart ``` ## Exim Documentation If your version of Exim does not match the version above or you are not finding the answer you need, please check out the Official [Exim Documentation](http://www.exim.org/docs.html) for more information. ================================================ FILE: content/docs/for-developers/sending-email/formio.md ================================================ --- seo: title: Form.io Integration description: How to integrate Form.io with SendGrid. keywords: Form.io, integrate title: Building Serverless Apps with Form.io + SendGrid group: partners weight: 100 layout: page navigation: show: true --- [Form.io](https://form.io) is a combined form and data management API platform created for developers who are building "Serverless" form-based applications. Form.io provides an easy drag-and-drop form builder workflow, allowing you to build complex forms for enterprise applications quickly and easily. These forms are then embedded directly into your application with a single line of code that dynamically renders the form (using Angular or React) in your app while at the same time generating the RESTful API to support those forms. The Form.io platform also offers numerous 3rd-party services that are fully integrated into the form building process, allowing you to extend the power and capability of your apps while saving time and effort. Form.io has recently announced the integration of SendGrid’s API into their list of standard “Form Actions”, allowing you to extend your SendGrid email capabilities further into your apps by automatically triggering emails through your SendGrid account when forms are submitted within your application. ![Form.io SendGrid integration]({{root_url}}/images/formio-sendgrid.png "Form.io SendGrid Integration") This step-by-step guide will show how to set up a SendGrid integration within the Form.io platform. ## Create your first Form.io project To get started, you will first need to create an account at [Form.io](https://portal.form.io). Once you have an account, you can quickly bootstrap an already working application by clicking on one of the provided templates on the home screen. These are not simple form templates, but rather fully functional applications complete with Data Resources, Forms, Actions, and User Roles/Permissions. For more on how these items function within Form.io, feel free to read through our [User Guide](https://help.form.io/userguide/) or view our [Video Tutorials](https://help.form.io/tutorials/videos/#welcome). ![Form.io Home Page]({{root_url}}/images/formio-home.png "Form.io Home Page") Once you have a project created, you can now view the project live within the Preview tab of the project portal. ## Configure your project Once you have a Form.io project, the next step is to create an **API Key** within your SendGrid account (under **Settings | API Keys**). Ensure that the API Key you create has **Full Access** for the **Mail Send** permission. Once you have your API Key, go back to your Form.io project and follow these steps. 1. Click the **Project Settings** button located at the top right of your screen. 1. Click the **Email Providers** tab on the left and then the **SendGrid Settings** tab. 1. Input the *SendGrid API Key* provided to you when the API key was created. 1. **Save** your settings. ![Form.io SendGrid Settings]({{root_url}}/images/formio-settings.png "Form.io SendGrid Settings") ## Adding an email action Now that you have your project configured to send emails through SendGrid, the next step is to add an email action to any form within your project. A good use case for this would be to send an email anytime someone registers for your application. To achieve this capability, please follow the following steps. 1. Click on the **Resources** tab within your project. 1. Next, click on the **Actions** button on the **User** resource. 1. Now select the **Email** action, and then press the **+ Add Action** button. ![Add Email Action]({{root_url}}/images/formio-add-email.png "Form.io Add Email Action") 4. Now on the email settings page, select **SendGrid** for the **Transport** of the action. 5. Input a **From** email address you would like to send the email from. 1. Input a **To** email address you would like to send the email to. For this, you can use handlebar notation, such as ```{{ data.user }}```, to access the data from the submission as you see in the following image. 1. Input a **Subject** for the message being sent. 1. Input a **Message** for the message being sent. ![Email Action Settings]({{root_url}}/images/formio-email-action.png "Form.io Email Action Settings") 9. **Save** the action. With this step complete, every user who registers for this application will receive your email which was sent through the SendGrid platform. ## Deploy your serverless application! Now that your project is configured for SendGrid, you can deploy it in a number of different ways including [GitHub Pages](https://pages.github.com/), [Apache Cordova](https://cordova.apache.org/), [Electron](http://electron.atom.io/), etc. You can also preview your application by clicking on the Preview tab of your project. Since this application is "serverless" it can be hosted in a wide range of places and immediately connect your forms with SendGrid! ![Form.io Launch]({{root_url}}/images/formio-launch.png "Form.io Launch") If you have any questions on the Form.io integration, please feel free to [Contact Form.io Support](https://form.io/#contact). Thanks and enjoy **SendGrid** and **Form.io**! ================================================ FILE: content/docs/for-developers/sending-email/getting-started-email-activity-api.md ================================================ --- seo: title: Getting Started with the Email Activity Feed API description: Use the Email Activity Feed query language to get started with the Email Activity Feed API. keywords: email activity, query language, email stats, email events title: Getting Started with the Email Activity Feed API group: sending-email weight: 0 layout: page navigation: show: true --- <call-out> In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity). </call-out> The API gives you access to query all of your stored messages, to query individual messages, and to download a CSV with data about the stored messages. ## Getting started Start with this basic query to the Email Activity Feed API (replace `<<your API key>>` with an API key from your account): ```bash curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10' \ --header 'authorization: Bearer <<your API key>>' ``` This returns a list of the 10 most recent emails you've sent. Next, check out some of the common use cases to narrow down your search. ### Encoding queries All queries need to be [URL encoded](https://meyerweb.com/eric/tools/dencoder/) and have this format: `query={query_type}="{query_content}"` Encoded, this query would look like this: `query=query_type%3D%22query_content%22` ## Queries for common use cases Here are some queries for common use cases. For a full list of possible query types, see the [query reference](#query-reference). ### Filter by subject Use this query to filter by email subject (replace `<<your API key>>` with an API key from your account, and replace <<subject>> with the subject you want to search): ```bash curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=subject%3D<<subject>>' \ --header 'authorization: Bearer <<your API key>>' ``` Subject queries have this format: `subject="This is a subject test"` Encoded, this query would look like this: `subject%3D%22This%20is%20a%20subject%20test%22` ### Filter by recipient email Use this query to filter by a recipient's email: (replace `<<your API key>>` with an API key from your account, and replace <<email>> with the URL encoded recipients email): ```bash curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=to_email%3D%22<<email>>%22' \ --header 'authorization: Bearer <<your API key>>' ``` Recipient email queries have this format: `to_email="example@example.com"` Encoded, this query would look like this: `to_email%3D%22example%40example.com%22` ### Filter by bounced emails Use this query to filter by all bounced emails: (replace `<<your API key>>` with an API key from your account): ``` curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=status%3D%22bounced%22' \ --header 'authorization: Bearer <<your API key>>' ``` Subject queries have this format: `status="bounced"` Encoded, this query would look like this: `status%3D%22bounced%22` ## Creating compound queries Use [operators and keywords](#keywords-and-operator-reference) to combine queries for a compound query. For example, you could filter for emails between a date range or you could filter for when a specific recipients email is bounced. Here are some common use cases: ### Filter by a recipient email that was bounced Use this query to filter by a recipient's email and by emails that are bounced: (replace `<<your API key>>` with an API key from your account, and replace <<email>> with the URL encoded recipients email): ``` curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=status%3D%22bounced%22%20AND%20to_email%3D%22<<email>>%22' \ --header 'authorization: Bearer <<your API key>>' ``` ### Filter by date range Use this query to filter to emails between specific dates: (replace `<<your API key>>` with an API key from your account, and replace {start_date} and {end_date} with a URL encoded UTC date string in this format: `YYYY-MM-DD HH:mm:SS`. Encoded, this looks like this: `2018-02-01T00%3A00%3A00.000Z`) ``` curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=last_event_time%20BETWEEN%20TIMESTAMP%20%22{start_date}%22%20AND%20TIMESTAMP%20%22{end_date}%22' \ --header 'authorization: Bearer <<your API key>>' ``` ### Filter by a recipient and a date range Use this query to filter to emails by recipient and between specific dates: (replace `<<your API key>>` with an API key from your account, replace <<start_date>> and <<end_date>> with a URL encoded UTC date string in this format: `YYYY-MM-DD HH:mm:SS`, and replace <<email>> with the URL encoded recipient's email) ``` curl --request GET \ --url 'https://api.sendgrid.com/v3/messages?limit=10&query=last_event_time%20BETWEEN%20TIMESTAMP%20%22{start_date}%22%20AND%20TIMESTAMP%20%22{end_date}%22AND%20to_email%3D%22<<email>>%22' \ --header 'authorization: Bearer <<your API key>>' ``` ## Keywords and Operator reference There are several operators and keywords that you can use to build [Compound queries](#creating-compound-queries). Use these operators between query statements. If the character used as the delimiter is found within the string. The escape character is `\`, which must be escaped with a preceding `\`. All queries need to be URL encoded. _This is a full list of accepted operators and keywords:_ - `=` - `!=` - `<` - `>` - `<=` - `>=` - `-` - to - `+` - `/` - `*` - `-` - subtraction - AND - BETWEEN - NOT BETWEEN - CONTAINS - DAY - FALSE - HOUR - IN - NOT IN - INTERVAL - IS - IS NOT - LIKE - NOT LIKE - MINUTE - MONTH - NOT - NULL - OR - SECOND - TIMESTAMP - TRUE - YEAR ## Query reference <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> This is a full list of basic query types and examples: (replace the data in quotes with the information you want to query, and then URL encode it) <table class="table" style="table-layout:fixed"> <tr> <th><b>Query</b></th> <th><b>Unencoded example</b></th> </tr> <tr> <td><code>msg_id</code></td> <td><code>msg_id="filter0307p1las1-16816-5A023E36-1.0"</code></td> </tr> <tr> <td><code>from_email</code></td> <td><code>from_email="testing@sendgrid.net"</code></td> </tr> <tr> <td><code>subject</code></td> <td><code>subject="This is a subject test"</code></td> </tr> <tr> <td><code>to_email</code></td> <td><code>to_email="example@example.com"</code></td> </tr> <tr> <td><code>status</code></td> <td><code>status="processed"</code></td> </tr> <tr> <td><code>template_id</code></td> <td><code>template_id="8f0d27bc-cf8f-42d3-b951-3990af7d0619"</code></td> </tr> <tr> <td><code>template_name</code></td> <td><code>template_name="example_template"</code></td> </tr> <tr> <td><code>campaign_name</code></td> <td><code>campaign_name="example_campaign"</code></td> </tr> <tr> <td><code>campaign_id</code></td> <td><code>campaign_id="1453849"</code></td> </tr> <tr> <td><code>api_key_id</code></td> <td><code>api_key_id="SG.xxxxxxxxxxxxxxxx"</code> (everything before the middle dot in the API key)</td> </tr> <tr> <td><code>events</code></td> <td><code>(Contains(events,"processed"))</code></td> </tr> <tr> <td><code>categories</code> - custom tags that you create</td> <td><code>(Contains(categories,"categories_example"))</code></td> </tr> <tr> <td><code>unique_args</code> - custom tracking arguments that you can attach to SMTP API calls</td> <td><code>unique_args="example argument"</code></td> </tr> <tr> <td><code>outbound_ip</code> - this is the SendGrid dedicated IP address used to send the email</td> <td><code>outbound_ip="4.77.777.77"</code></td> </tr> <tr> <td><code>last_event_time</code></td> <td><code>last_event_time="2017-11-07T23:13:58Z"</code></td> </tr> <tr> <td><code>clicks</code></td> <td><code>clicks="0"</code></td> </tr> <tr> <td><code>asm_group_id</code></td> <td><code>asm_group_id="1041"</code></td> </tr> <tr> <td><code>teammate</code> - teammates username</td> <td><code>teammate="my_username"</code></td> </tr> </table> ## Additional Resources - [Email Activity Feed API Reference](https://sendgrid.api-docs.io/v3.0/email-activity/filter-all-messages) - [Email Activity Feed UI]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) ================================================ FILE: content/docs/for-developers/sending-email/getting-started-smtp.md ================================================ --- seo: title: How to Send an SMTP Email description: Use Telnet to send your first SMTP email. SendGrid’s SMTP API allows developers to specify custom handling instructions for email using an X-SMTPAPI header inserted into the message. keywords: telnet, ports, connection, SMTP, send email, getting started title: How to Send an SMTP Email group: smtp weight: 960 layout: page navigation: show: true --- You can also send email with [the UI]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) and with [the API]({{root_url}}/api-reference/). ## What is SMTP? [Simple Mail Transfer Protocol (SMTP)]({{root_url}}/glossary/smtp/) is a quick and easy way to send email from one server to another. SendGrid provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server. This means you can count on SendGrid's delivery at scale for your SMTP needs. SendGrid’s SMTP API also allows you to specify custom email handling instructions using a JSON encoded list called the [X-SMTPAPI header]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/). The X-SMTPAPI header is parsed by SendGrid to modify your message in the ways you specify. For a deeper dive into what SMTP is, the benefits of sending an email with SMTP, and how SendGrid can help, see the [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) on our blog. ## Sending a test SMTP email with Telnet This page will help you send a first test message using Telnet. Once you complete this process, you will be better prepared to explore and build messages using the [X-SMTPAPI header]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/). ### Prerequisites Be sure to perform the following prerequisites to complete this tutorial. 1. Sign up for a [SendGrid account](https://signup.sendgrid.com/) 2. Create and store a SendGrid [API key](https://app.sendgrid.com/settings/api_keys) with full access "Mail Send" permissions. 3. Verify your [Sender Identity]({{root_url}}/for-developers/sending-email/sender-identity/) 4. Open your terminal, also commonly referred to as a command prompt, or command line. You'll use the terminal to encode your API key and input the commands that initiate a Telnet connection. <call-out> In the following code samples, greater than and less than symbol are wrapped around placeholder values (e.g., `<YOUR_API_KEY>`). You should replace the greater than and less than symbols and the text inside them with an actual value. For example, `echo -n '<YOUR_API_KEY>' | openssl base64` will become `echo -n 'SG.someactualkey' | openssl base64` if your API key is `SG.someactualkey`. In some cases you will see two sets of greater than and less than symbols wrapping a placeholder. In this case, one set of greater than and less than symbols is required in the actual value and should not be replaced. For example, `From: "Example" <<example@example.com>>` will become `From: "Example" <example@example.com>`. </call-out> Once you have your terminal open and have saved your API key, you must Base64 encode the API key. Note that it is not secure to put your API key into an external webpage for a conversion, so we recommend using a conversion in your terminal. If you are on Mac or Linux, you can use the pre-installed OpenSSL package to Base64 encode a string with the following command. ```shell echo -n '<YOUR_API_KEY>' | openssl base64 ``` Save your encoded key for a later. Also, be sure you have not included any newline or whitespace characters by accident. This can happen when copying the encoded key from a shell that line wraps output. SMTP is a line-oriented protocol, and linefeed characters will prevent you from authenticating successfully. <call-out type="warning"> Telnet does not register backspaces correctly, so you must type your commands correctly or copy and paste them from this page. </call-out> ### Send an SMTP email using Telnet: <call-out> You may need to install Telnet on your machine. Telnet comes natively on some operating systems; However, recent releases of MacOS no longer include Telnet, and Telnet must be enabled manually on Windows 10. You can install Telnet on MacOS using [Homebrew](https://brew.sh/). To enable Telnet on Windows 10, navigate to **Windows Features** > **Turn Windows Features on or off** from the Windows **Control Panel**. Check the box next to **Telnet Client**, and select **OK**. </call-out> 1. Start a Telnet session by typing the following in the terminal: ```shell TELNET smtp.sendgrid.net 25 ``` SendGrid accepts unencrypted and TLS connections on ports **25**, **587**, & **2525**. You can also connect via SSL on port **465**. Many hosting providers and ISPs block port 25 as a default practice. If your Telent session continually times out or will not connect using port 25, it is likely that your ISP or hosting provider is blocking the port. You can contact your host/ISP to find out which ports are open for outgoing SMTP relay. We recommend using port 587 to avoid any rate limiting that your server host may apply. 2. Once you successfully connect to SendGrid, log in to the server by typing the following: ```shell AUTH LOGIN ``` The mail server will respond with `334 VXNlcm5hbWU6`, which is a Base64 encoded request for your username. 3. Input `YXBpa2V5` and press **Enter** on your keyboard. Twilio SendGrid requires you to authenticate using an API key. When using Basic Authentication and an API key, you must use the string `apikey` in place of your account username. The string `apikey` is `YXBpa2V5` when Base64 encoded, which is why we use it in this step. The mail server will respond with `334 UGFzc3dvcmQ6`. This response is a Base64 encoded request for your password (your API Key). 4. Enter your Base64 converted API key in the next line as the password and press **Enter**. The mail server will respond with `235 Authentication successful`. Getting this far indicates that your connection to `smtp.sendgrid.net` over the chosen port is open and that your API key is valid. 5. Next, add the email that you’re sending from using the SMTP MAIL FROM command and press **Enter**. ```shell MAIL FROM: <SENDER_EMAIL> ``` The mail server will respond with `250 Sender address accepted`. 6. Add the email that you’re sending to using the SMTP RCPT TO command and press **Enter**. ```shell RCPT TO: <RECIPIENT_ADDRESS> ``` Note that you can add more RCPT TO addresses during this step. Repeat the process by adding another RCPT TO command and pressing **Enter** for each recipient you intend to deliver the message to. The mail server will respond with `250 Recipient address accepted` after each recipient is added. 7. On the next line, type `DATA` and press **Enter**. The mail server will respond with `354 Continue`. Unlike the MAIL FROM and RCPT TO commands, which are part of the email envelope, the DATA command is not meant to contain information that routes your email from a sender to a recipient. Instead, DATA allows you to modify the content of your message. 8. Optionally, add a mail-to header to add the name and email address of the recipient to the email header and press **Enter**. Note that the name should be wrapped in quotation marks, and the address should be wrapped in a greater than and less than symbol. ```shell To: "<RecipientName>" <<RecipientEmailAddress>> ``` 9. Next, add a from header to add the name and email address of the sender to the email header and press **Enter**. If a from header is not included, SendGrid will block your email because it doesn’t follow [RFC 5322](https://tools.ietf.org/html/rfc5322) compliance guidelines. Note that the name should be wrapped in quotation marks, and the address should be wrapped in a greater than and less than symbol. ```shell From: "<SenderName>" <<SenderEmail>> ``` 10. Include a subject line and press **Enter**. ```shell Subject: <EMAIL_SUBJECT> ``` 11. Add the body content of the message and press **Enter**. ```shell "<MESSAGE>" ``` For example: ``` “This is a test for the SMTP relay." ``` 12. Finally, send the email by typing a period, `.`, and then pressing **Enter**. The mail server will return `250 Ok: queued as <examplestring1234>`. This means the email has been queued to send. The queue moves very quickly, and you should see mail delivered to the designated recipients shortly. 13. Exit the Telnet connection by typing `quit` and pressing **Enter**. The full command should look like the following example. ```shell 235 Authentication successful MAIL FROM:tiramisu@example.com 250 Sender address accepted RCPT TO:person1@sendgrid.com 250 Recipient address accepted DATA 354 Continue From: "Tira Misu" <tiramisu@example.com> To: "Person 1" <person1@sendgrid.com> Subject: Test message subject "This is the test message body." . 250 Ok: queued as Yo60h6C5ScGPeP5fUWU3K ``` Now that you've sent a test email, learn to [integrate your servers with our SMTP service]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/). <call-out> Message size limit: The total message size should not exceed 20MB. This includes the message itself, headers, and the combined size of any attachments. </call-out> <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## Additional Resources - [Getting Started with the UI]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [Getting Started with the API]({{root_url}}/for-developers/sending-email/api-getting-started/) - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Integrating with the SMTP API]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) ================================================ FILE: content/docs/for-developers/sending-email/getting-started-with-transactional-emails.md ================================================ --- seo: title: Getting Started with Transactional Email description: Using SendGrid to send Transactional Email. keywords: Getting Started, API, v3, REST, Transactional Email title: Getting Started with Transactional Email group: api-v3 weight: 100 layout: page navigation: show: true --- SendGrid is perfect for sending Transactional Emails. ## What is Transactional Email? Transactional Email is a type of email sent to facilitate an agreed-upon transaction between the sender and the recipient. Transactional emails typically contain information a recipient wants or needs and consequently have very high open rates. Common transactional email use cases include, account creation emails, password resets, purchase receipts, account notifications, and social media updates like friend and follower notifications. These emails typically contain information a user wants or needs. They have the highest open rates across all categories of email. <call-out> Well designed and useful emails help keep open rates high. Use ([SendGrid’s Dynamic Transactional Email Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/)) to help with the creation of responsive transactional email templates. </call-out> Read more about Transactional Email in the [SendGrid Guide]({{root_url}}/glossary/transactional-email/). ## How to send a Transactional Email Once your SendGrid account is set up, you have choices on how to send the emails to your users. 1. Send [via SMTP]({{root_url}}/for-developers/sending-email/getting-started-smtp/) 2. Send [via API]({{root_url}}/api-reference) 3. Send via other options like [Open Source]({{root_url}}/for-developers/sending-email/libraries/) and [plugins]({{root_url}}/for-developers/sending-email/wordpress-plugin/) ## Additional Resources For more information on SendGrid and where you can go from here, check out these pages: - [Transactional Emails]({{root_url}}/glossary/transactional-email/) - [API Reference]({{root_url}}/api-reference/) - [How to Send Email]({{root_url}}/for-developers/sending-email/) ================================================ FILE: content/docs/for-developers/sending-email/how-to-create-a-subuser-with-the-api.md ================================================ --- seo: title: How to Create a Subuser with the API description: How to Create a Subuser with the API keywords: subuser, api, IP, account, new, create, /customer. title: How to Create a Subuser with the API group: api-v3 weight: 0 layout: page zendesk_id: 201750787 navigation: show: true --- Creating a new subuser through SendGrid's API is a multi-step process. This guide will walk you through the necessary steps to create a new subuser account using only API calls. ## Establish the New Subuser (required) With the [subuser creation API call](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/subusers) you will be able to establish the new subuser's account and profile settings. This call will create the new subuser account. However, it does not apply the sending IP for the account, nor does it establish a domain authentication entry or enable website/SMTP access for the subuser. #### Call Example ``` https://api.sendgrid.com/apiv2/customer.add.json?api_user=ryan.burrer@sendgrid.com&api_key=xxxxxx&username=newsubuser_username&website=yourdomain.com&password=newsubuser_password&confirm_password=newsubuser_password&first_name=Ryan&last_name=Burrer&address=555_anystreet&city=any_city&state=CO&zip=80203&email=example@example.com&country=US&phone=555-5555 ``` <center> <strong>Success Message<br></strong><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/5e355c42-487e-442a-bd2b-89c9d80dd7d0/00000094.png" alt=""><center><strong> <br>Failure Message<br></strong></center> <img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/d8482205-976f-4f82-ad3a-77503e867c2f/00000095.png" alt=""> <strong><span class="wysiwyg-font-size-medium"><br><br></span></strong> </center> ## Assign an IP to be Used by the New Subuser (required) Now that you have created the new subuser account, you will need to [add an IP](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/ip_management) so that it can send emails. We advise that you first find an available IP for this subuser. You can do so by using the following call: #### Call Example ``` https://api.sendgrid.com/apiv2/customer.ip.xml?api_user=ryan.burrer@sendgrid.com&api_key=xxxxxx&list=all ``` When defining the parameter 'list', there are a few options you can choose: - **All** - Will list all of the IPs on your account, taken or available. - **Free** - Will list all the free IPs on your account. For instance, if an IP is in use by a subuser or parent account then that IP will not be listed. - **Taken** - Will list all of the IP addresses that are assigned to your parent and subuser accounts. - **Available** - Will list all of the unassigned IP addresses for the account. If a subuser is deactivated \_and it \_is assigned an IP, that IP will show up on this list since that IP address is not technically in use. <center> <strong>Response Example<br></strong><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/0dc1923b-fff9-4446-aff1-5dcab41929a4/00000096.png" alt="" align="middle"> </center> After you have selected the IP that you wish to assign to your subuser account, make the API call to [append the IP address](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/ip_management). #### Call Example ``` https://api.sendgrid.com/apiv2/customer.sendip.json?api_user=ryan.burrer@sendgrid.com&api_key=xxxxxx&task=append&set=specify&user=newsubuser_username&ip[]=255.255.255.250&ip[]=255.255.255.255 ``` When defining this call's 'set' parameter, you have a few options for appending the subuser's IP: - **None** - removes all of the IPs on the associated account. - **All** - applies all of the possible IPs to the account. - **Specify** - Specify the IPs to the subuser <center> <strong>Success Message</strong> <p class="wysiwyg-text-align-left"><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/5e355c42-487e-442a-bd2b-89c9d80dd7d0/00000094.png" alt="" align="middle"></p> <strong>Failure Message</strong> <p class="wysiwyg-text-align-left"><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/d8482205-976f-4f82-ad3a-77503e867c2f/00000095.png" alt="" align="middle"></p> </center> ## Assign a domain authentication for the Subuser Account (optional) After you have created the subuser account and have appended an IP address, you are now ready to assign an _existing_ [authenticated domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) to the account. If you have not yet created the required records for authenticating your chosen domain then this step should be skipped. First, you should find out what authenticated domains you have associated with your account. This call will [list your available authenticated domains](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/whitelabel#list): #### Call Example ``` https://api.sendgrid.com/apiv2/customer.whitelabel.json?api\_user=ryan.burrer@sendgrid.com&api\_key=xxxxxx&task=list ``` <center> <strong>Response Example</strong> <p class="wysiwyg-text-align-left"><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/9d491f57-d3c8-4376-a31d-a04b49590747/00000097.png" alt=""></p> </center> The API response above shows that email.sendgrid.com and email.example.com are both already established domain entries, and can be used by this subuser. If none are displayed then the next step in this process should be skipped. If you have an authenticated domain entry that you wish to apply to your subuser then you will need to [append the authenticated domain entry](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/whitelabel) to your subuser: #### Call Example ``` https://api.sendgrid.com/apiv2/customer.whitelabel.json?api_user=ryan.burrer@sendgrid.com&api_key=xxxxxx&task=append&user=newsubuser_username&mail_domain=YOUR.ALREADY.EXISTING.AUTHENTICATED_DOMAIN ``` <center> <strong>Success Message</strong> <p class="wysiwyg-text-align-left"><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/5e355c42-487e-442a-bd2b-89c9d80dd7d0/00000094.png" alt="" align="middle"></p> <strong>Failure Message</strong> <p><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/d8482205-976f-4f82-ad3a-77503e867c2f/00000095.png" alt=""></p> </center> ## Authenticating the Subuser to Have Website/SMTP Access (required) The final step in creating your new subuser requires you to [activate the subuser](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/authenticate_a_subuser) account so that they have a website and SMTP access. #### Call Example ``` https://api.sendgrid.com/apiv2/customer.auth.json?api_user=ryan.burrer@sendgrid.com&api_key=xxxxxx&user=newsubuser_username&password=newsubuser_password ``` <center> <strong>Success Message</strong> <p><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/5e355c42-487e-442a-bd2b-89c9d80dd7d0/00000094.png" alt="" align="middle"></p> <strong>Failure Message</strong> <p><img src="http://content.screencast.com/users/Ryan.Burrer/folders/Jing/media/d8482205-976f-4f82-ad3a-77503e867c2f/00000095.png" alt=""></p> </center> <center> ## Additional Resources - [Automating Subusers]({{root_url}}/for-developers/sending-email/automating-subusers/) - [Event Notification URL](https://www.twilio.com/docs/sendgrid/api/v2/reseller_api/reseller_customer_subuser_api/customer_subuser_event_notification_url) - [Apps](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/apps) - [Account Limits](https://www.twilio.com/docs/sendgrid/api/v2/customer_subuser_api/account_limits) ================================================ FILE: content/docs/for-developers/sending-email/how-to-use-a-transactional-template-with-smtp-or-v2.md ================================================ --- seo: title: Sending a Legacy Transactional Template Email over SMTP or v2 description: Learn how to send a legacy transactional template with the SMTP API. keywords: SMTP, send email, integrate, building, filters, scheduling, substitution, suppression groups, unique arguments, recipients, legacy template, transactional template title: Sending a Legacy Transactional Template Email over SMTP group: x-smtpapi weight: 949 layout: page navigation: show: true --- <call-out> ### Who should consider using the X-SMTPAPI? For customers who are unable to use the Web API v3, SMTP or v2 is an acceptable option. </call-out> <call-out type="warning"> The X-SMTPAPI does not support Dynamic Transactional Templates. For sending Dynamic Transactional Templates you need to use v3 Mail Send. * [How to send an email with Dynamic Transactional Templates]({{root_url}}/for-developers/sending-email/how-to-send-an-email-with-dynamic-transactional-templates) - [Getting Started with the v3 Mail Send API]({{root_url}}/for-developers/sending-email/api-getting-started/) </call-out> ## Before you begin Before you create and send a legacy transactional template email over SMTP you need to do the following: * [Integrate with the SendGrid SMTP API]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) * [Send a test email over SMTP]({{root_url}}/for-developers/sending-email/getting-started-smtp/) * [Build an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) * [Create a Legacy Transactional Template](https://sendgrid.com/templates) ## Sending a test Email ### Sending a test SMTP email with Telnet [Sending a test SMTP email with Telnet](/for-developers/sending-email/getting-started-smtp/#sending-a-test-smtp-email-with-telnet) is one of the most basic tests you can do. This test is useful in checking the connection and determining if the most basic of problems: * Is the server up? * Is there a firewall blocking communication? * Does the mail server allow for relaying of a particular domain/email address? * What SMTP commands does the mail server support? * Does the server respond with the correct hostname? * Does the connection work outside any third party software or APIs? ## Sending an Email ### Code Examples with different clients for SMTP * [SMTP Go Code Example]({{root_url}}/for-developers/sending-email/smtp-go-code-example/) * [SMTP Node.js Code Example]({{root_url}}/for-developers/sending-email/smtp-nodejs-code-example/) * [SMTP PHP Code Example]({{root_url}}/for-developers/sending-email/smtp-php-code-example/) * [SMTP Perl Code Example]({{root_url}}/for-developers/sending-email/smtp-perl-code-example/) * [SMTP Python Code Example]({{root_url}}/for-developers/sending-email/smtp-python-code-example/) * [SMTP Ruby Code Example]({{root_url}}/for-developers/sending-email/smtp-ruby-code-example/) ### Sending via v2 mail send * [Go Code Example]({{root_url}}/for-developers/sending-email/v2-go-code-example/) * [Node.js Code Example]({{root_url}}/for-developers/sending-email/v2-nodejs-code-example/) * [PHP Code Example]({{root_url}}/for-developers/sending-email/v2-php-code-example/) * [Perl Code Example]({{root_url}}/for-developers/sending-email/v2-perl-code-example/) * [Python Code Example]({{root_url}}/for-developers/sending-email/v2-python-code-example/) * [Ruby Code Example]({{root_url}}/for-developers/sending-email/v2-ruby-code-example/) * [C# Code Example]({{root_url}}/for-developers/sending-email/v2-csharp-code-example/) * [Java Code Example]({{root_url}}/for-developers/sending-email/v2-java-code-example/) ### Enabling a Template <call-out> Make sure that the version of the template you want to use is set to active by using: - The [Activate a transactional template version endpoint](https://sendgrid.com/docs/api-reference/) ```/templates/{template_id}/versions/{version_id}/activate``` - Or by [activating the template version in the UI](https://sendgrid.com/templates) </call-out> To use a legacy template when you send, configure the `X-SMTPAPI` header of an SMTP message: * Enable the `templates` filter * Set the `template_id` to one of your legacy transactional templates #### Example ```json { "filters": { "templates": { "settings": { "enable": 1, "template_id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f" } } } } ``` ### Set the Body and Subject Tags The `<%subject%>` property is used for both Text and HTML templates. The ```text``` property is substituted into the `<%body%>` of the text template and ```html``` is substituted into the `<%body%>` of the HTML template. **Text or HTML Templates?** <call-out> It is best practice to provide content for both the ```html``` and the ```text``` properties in all of your emails. If the ```text``` property is present, but not ```html```, then the resulting email will only contain the text version of the template, not the HTML version. </call-out> Enabling a legacy template means that the `subject` and `body` content of your message will behave differently. * If you want only the message's content to be displayed, populate only the token in the template's field. * If you want only the template's content to be displayed, leave the message field (subject or body) empty, and the template will populate. ## Advanced options You can use X-SMTPAPI [substitution]({{root_url}}/for-developers/sending-email/substitution-tags/) and [section]({{root_url}}/for-developers/sending-email/section-tags/) tags in your template's subject and body content, and they will be replaced with the values specified when you send the message. ### Substitution Tags [Substitution tags]({{root_url}}/for-developers/sending-email/substitution-tags/) allow you to generate dynamic content for each recipient on your list. When you send to a list of recipients over SMTP API, you can specify substitution tags specific to each recipient. ### Section Tags [Section tags]({{root_url}}/for-developers/sending-email/section-tags/) allow you to substitute in content in an SMTP message. Section tags are similar to substitution tags but are specific to the message, and not the recipient. Section tags have to be contained within a Substitution tag since SendGrid needs to know which data to populate for the recipient. ================================================ FILE: content/docs/for-developers/sending-email/iis75.md ================================================ --- layout: page weight: 0 title: Microsoft IIS 7.5 group: mail-servers navigation: show: true --- <call-out> This document was written using Windows Server 2008 R2 running IIS version 7.5 and ASP.NET scripting technology for sending email. If you require SSL/TLS, you will need to configure those elements separately. </call-out> ## IIS 7.5 Configuration Before you get going, you'll need to set up IIS in order to support SendGrid integration. This tutorial assumes that you have set up a working site and that the root directory tests as valid. 1. Open IIS 7.0/7.5 Manager in Windows. 2. Click on your site (see image below, noting that your configuration will look different), and the main configuration options page will be displayed to the right. 3. Double-click **SMTP E-mail** under the ASP.NET section. 4. In the email address field: type the email address that will be the "sender". 5. Select **Deliver e-mail to SMTP server**. 6. In the SMTP Server field: type localhost. 7. In the Port field: type 25. 8. In Authentication Settings, select **Not required**. 9. Click **Apply**. <center> ![]({{root_url}}/images/iis_mgr_site.png "IIS Manager") </center> <call-out> If you want to configure additional security to the localhost IIS 6.0 server you would set it here and match the same authentication in the IIS 6.0 GUI. </call-out> ## Enable SMTP Service 1. Go to Start \> All Programs \> Administrative Tools \> Server Manager 2. Click **Features** in the navigation pane. 3. Click **Add Features** to start the wizard. 4. Scroll down the list to the SMTP Server, and check the box. The Required Role Services dialog will appear, listing all of the dependencies that the SMTP server depends on to operate. Click **Add Require Role Services**. 5. Click **Next** twice. 6. Review the list of available IIS Role Services and check any that you would like to add. 7. Click **Next** then click **Install**. Once the SMTP Server service is installed, the IIS 6.0 virtual server technology is activated, and the IIS 6.0 administration snap-in will now be active. ## Configure IIS 6.0 to Relay Outbound Email to SendGrid 1. Go to Start \> All Programs \> Administrative Tools \> IIS 6.0 Manager. 2. Right click on the SMTP Virtual Server \#1 and select **Properties**. 3. Click the box to enable logging section to assist you in configuring the server. 4. Select **Properties** and check the box to activate *Use Local Time For File Naming And Rollover* option. 5. Select **Advanced** and check the following items: Date, Time, Client IP Address, User Name, Service Name, Server Name, Server IP Address, Server Port, Method, Protocol Status, Bytes Sent, Protocol Version, and Host. 6. Click **OK**. 7. Click on the Access tab the select **Relay** in the Relay Restrictions section. 8. Click Add, enter 127.0.0.1, and click OK. The IP appears in the list with Access Granted. 9. Click **OK Only The List Below** and enter 127.0.0.1 in the IP address field. 10. Click **OK** to return to the Access tab as shown in the previous screenshots. 11. Select Delivery and click **Outbound Security**. 12. Select **Basic Authentication** and enter `apikey` as your username and the password will be your SendGrid [API Key]({{root_url}}/ui/account-and-settings/api-keys/). 13. Click **OK**. 14. Click **Advanced**. 15. In the Smart host field: enter smtp.sendgrid.net 16. Click on OK twice and you can close the IIS 6.0 admin MMC ## Configure Domains At this point you will need to configure an SMTP domain that relays messages to SendGrid. Please follow [Microsoft's instructions](https://support.microsoft.com/en-us/help/230235/xcon-how-to-configure-the-iis-smtp-service-to-relay-smtp-mail). ## Testing Your New Configuration First, let's test using Telnet. Open up a telnet client within Windows. You can do that in the Command Prompt by entering the following: ``` telnet localhost 25 ``` Now, with telnet running, enter the following commands just as you see them, pressing ENTER for each new line (if configured correctly, the server won't do anything until you enter the period): ``` EHLO yourdomain.com MAIL FROM: test@yourdomain.com RCPT TO: recipient@anotherdomain.com DATA This is a test email for SendGrid operations. . ``` The `EHLO` command with your domain inserted tells the mail server which domain it will be sending from. The `MAIL FROM:` command is a standard MIME entry for that inserts the email address of the sender. The `RCPT TO:` command tells the server to which address to send the message. The `DATA` command tells the server that the next incoming information is the body of the message. Finally, after the data is entered, the period (.) tells the server you are done. When you press Enter, it will send the message. It's quite nice to have servers to handle all this mess, isn't it! If these manually entered commands work, then you should have the following success code returned: ```250….Queued mail for delivery``` You can also test using the logging feature we had you activate earlier. You can view the logs by navigating to and opening the IIS 6.0 7.5 log files with a text editor. It will probably be under the C:\\Windows\\System32\\LogFiles directory unless you changed the log file location during installation. Notice, highlighted in blue below, that the server sent an email and that it went through various OutboundConnectionCommand and Outbound ConnectionResponse steps. These along with the information of the various stages of EHLO, AUTH, MAIL, RCPT, DATA, and quit that the email was sent successfully. Finally, you can confirm that your configuration is working by logging into our site. Login into our web UI using your SendGrid credentials. On the main Dashboard tab you will see a list of messages that were recently sent through our service. This number should increment by one each time you either use telnet to send an email or you use an ASP.NET test script. ================================================ FILE: content/docs/for-developers/sending-email/integrating-with-the-smtp-api.md ================================================ --- seo: title: Integrating with the SMTP API description: Set your systems up to use SendGrid's SMTP API keywords: ports, connection, SMTP, send email, integrate, rate limits, setting up title: Integrating with the SMTP API group: smtp weight: 950 layout: page navigation: show: true --- ## Integrating with SendGrid _To integrate with SendGrid's SMTP API:_ 1. [Create an API Key](https://app.sendgrid.com/settings/api_keys) with at least "Mail" permissions. 2. Set the server host in your email client or application to `smtp.sendgrid.net`. This setting is sometimes referred to as the _external SMTP server_ or the _SMTP relay_. 3. Set your username to the string `apikey`. This setting is the exact string "apikey" and not the API key itself. 4. Set your password to the API key generated in step one. 5. Set the port to `587` (or as specified below). <call-out> When submitting base64 encoded API key values, be sure you have not included any newline or whitespace characters by accident. This can happen when copying the encoded key from an environment that line wraps output. SMTP is a line-oriented protocol, and linefeed characters will prevent you from authenticating successfully. </call-out> ### SMTP ports - For an unencrypted or a [TLS connection]({{root_url}}/ui/sending-email/ssl-vs-tls/), use port `25`, `2525`, or `587`. - For a [SSL connection]({{root_url}}/ui/sending-email/tls/), use port `465`. <call-out> If you are unsure which port to use, a TLS connection on port 587 is typically recommended. To better understand the difference between ports 465 and 587, see the Twilio SendGrid blog post, ["What's the Difference Between Ports 465 and 587"](https://sendgrid.com/blog/whats-the-difference-between-ports-465-and-587). </call-out> ### Build SMTP email Now that you've integrated, learn to [build SMTP email]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/). ### Rate limits - You may send up to **5k messages per SMTP connection**. - You may open up to **10k concurrent connections from a single server**. ## Additional resources - [Sending email]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [Getting Started with the API]({{root_url}}/api-reference/) - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) ================================================ FILE: content/docs/for-developers/sending-email/interspire.md ================================================ --- seo: title: Interspire Integration description: Interspire Integration keywords: marketing, interspire, integration title: Interspire Integration group: partners weight: 0 layout: page zendesk_id: 200182048 navigation: show: false --- ## Why to integrate Interspire with SendGrid Interspire's [Email Marketer](http://www.interspire.com/emailmarketer/) is a powerful email marketing tool used by some SendGrid customers to carry out more in-depth marketing campaigns. Email Marketer has all the bells and whistles of an email marketing suite, and it's really good at helping customers carry out marketing campaigns from start to finish. SendGrid is really good at giving mail senders all the necessary tools to ensure their mail gets delivered to the inbox. This is why some customers choose to create their email marketing campaigns with Interspire and send the mail through SendGrid, to ensure optimized deliverability of the mail to the inbox. Luckily, Interspire makes this integration with SendGrid simple. ## How to integrate Interspire with SendGrid First things first, you'll need to log into your Email Marketer account. Once you've done that you can set the application's outbound mail server to point to SendGrid, allowing you to send the mail to us so we can send it to the end recipient. You'll want to navigate to the Dashboard within the account, which should look like this: ![Interspire_doc.1.png](https://sendgrid.zendesk.com/attachments/token/adaznndwouktdj1/?name=Interspire_doc.1.png) You'll then want to navigate to **Settings > Email Settings** in the upper right corner of the Dashboard. Once inside the Email Settings page you will see the "Mail Server Details" header near the bottom of the page: ![Interspire_doc.2.png](https://sendgrid.zendesk.com/attachments/token/poikwudjgiidmmx/?name=Interspire_doc.2.png) In order to set Email Marketer's outbound mail server to point to SendGrid, click the "Let me specify my own SMTP server details" bubble. From there, input the following authentication details: - **SMTP Hostname** : smtp.sendgrid.net - **SMTP Username** : [your SendGrid account's username] - **SMTP Password** : [your SendGrid API key] - **SMTP Port** : [the port of your choosing. For more information, see [How to Send an SMTP Email]({{root_url}}/for-developers/sending-email/getting-started-smtp/)] Once these settings changes have been made within the Email Settings page within your Email Marketer account, all mail from the application will be sent to SendGrid so we can send it to the end recipient. Simple as that. ## Bounce integration A bounce event occurs when mail is not able to be handed off to the mail servers at the end recipient's address. This could happen for a number of reasons such as a full mailbox at the address, or the address not existing at all. SendGrid generates a Bounces suppression list when you send mail to addresses that end up bouncing. We suppress subsequent mail to these addresses unless you tell us otherwise in the Email Reports tab within your account. There are 2 primary ways you can integrate these bounces, generated by SendGrid's system, with Email Marketer. You can download a CSV file of bounced addresses by navigating to Email Reports > Bounces within your SendGrid account. You can then upload this list into Email Marketer's system in order to mark "subscribers" as "unsubscribed." You can also handle bounces more programmatically by using our Event API to capture POSTed events and then unsubscribing subscribers in the Email Marketer system by making calls to their XML API. More info on SendGrid's Event API can be found [here](https://sendgrid.api-docs.io/v3.0/webhooks) More info on Interspire's XML API can be found [here](https://www.interspire.com/xml-api-documentation) ================================================ FILE: content/docs/for-developers/sending-email/joomla.md ================================================ --- layout: page weight: 0 title: Joomla group: open-source navigation: show: true --- Joomla supports sending email over SMTP. To have Joomla relay email through SendGrid go to _Site \> Global Configuration_ and change: - **Mailer** – SMTP - **SMTP Host** - smtp.sendgrid.net - **SMTP Port** – 587 - **SMTP Security** – STARTTLS - **SMTP Authentication** - Yes - **SMTP User** - "apikey" SMTP User must be the exact string, "apikey" - **SMTP Pass** - <Your API Key> SMTP Pass is your actual API key ================================================ FILE: content/docs/for-developers/sending-email/laravel.md ================================================ --- layout: page weight: 0 group: frameworks title: Laravel seo: title: Send Email with Laravel & SendGrid description: View instructions on how to easily send email with Laravel using SendGrid, by setting up setting up Laravel's Mailables Class. navigation: show: true --- Laravel provides a clean API over the popular SwiftMailer library with drivers for SMTP, PHP's `mail`, `sendmail` and more. For this example, we'll be sending an email with SendGrid using the SMTP Driver. For more information, check out the docs for [Laravel's Mail interface](http://laravel.com/docs/mail). Laravel 5.5 LTS uses Mailable classes. Mailables in Laravel abstracts building emails with a mailable class. Mailables are responsible for collating data and passing them to views. ## Before you begin Check your `.env` file and configure these variables: ``` MAIL_MAILER=smtp # MAIL_DRIVER=smtp # for laravel < 7 MAIL_HOST=smtp.sendgrid.net MAIL_PORT=587 MAIL_USERNAME=apikey MAIL_PASSWORD=sendgrid_api_key MAIL_ENCRYPTION=tls MAIL_FROM_NAME="John Smith" MAIL_FROM_ADDRESS=from@example.com ``` <call-out> Set the `MAIL_USERNAME` field to "apikey" to inform SendGrid that you're using an API key.<br> </call-out> <call-out> The `MAIL_FROM_NAME` field requires double quotes because there is a space in the string.<br> </call-out> <call-out> You can send `100 messages per SMTP connection` at a time, and open up to `10 concurrent connections` from a single server at a time. </call-out> ## Creating a Mailable <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Next you need to create a Mailable class, Laravel's CLI tool called Artisan makes that a simple feat. Open CLI, go to the project directory and type: `php artisan make:mail TestEmail` This command will create a new file under `app/Mail/TestEmail.php` and it should look something like this: ```php <?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Queue\ShouldQueue; class TestEmail extends Mailable { use Queueable, SerializesModels; public $data; public function __construct($data) { $this->data = $data; } public function build() { $address = 'janeexampexample@example.com'; $subject = 'This is a demo!'; $name = 'Jane Doe'; return $this->view('emails.test') ->from($address, $name) ->cc($address, $name) ->bcc($address, $name) ->replyTo($address, $name) ->subject($subject) ->with([ 'test_message' => $this->data['message'] ]); } } ``` In Laravel `Views` are used as 'templates' when sending an email. Let's create a file under `app/resources/views/emails/test.blade.php` and insert this code: ```html <!DOCTYPE html> <html lang="en-US"> <head> <meta charset="utf-8" /> </head> <body> <h2>Test Email</h2> <p>{{ $test_message }}</p> </body> </html> ``` ## Sending an email Now that we have our Mailable Class created, all we need to do is run this code: ```php <?php use App\Mail\TestEmail; $data = ['message' => 'This is a test!']; Mail::to('john@example.com')->send(new TestEmail($data)); ``` ## Adding a category or custom field Categories in SendGrid allow you to split your statistics into sections. Another useful tool is event notifications. If you want to complete the feedback loop for your product you can pass identifiers as a header which relate to a record in your database which you can then parse the notifications against that record to track deliveries/opens/clicks/bounces. The `withSwiftMessage` method of the `Mailable` base class allows you to register the callback that is invoked with the raw SwiftMailer message instance before sending the message. This knowledge allows you to customize the message before delivery. To customize your message, use something similar to this: ```php <?php namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Queue\ShouldQueue; class TestEmail extends Mailable { use Queueable, SerializesModels; public $data; public function __construct($data) { $this->data = $data; } public function build() { $address = 'janeexampexample@example.com'; $subject = 'This is a demo!'; $name = 'Jane Doe'; $headerData = [ 'category' => 'category', 'unique_args' => [ 'variable_1' => 'abc' ] ]; $header = $this->asString($headerData); $this->withSwiftMessage(function ($message) use ($header) { $message->getHeaders() ->addTextHeader('X-SMTPAPI', $header); }); return $this->view('emails.test') ->from($address, $name) ->cc($address, $name) ->bcc($address, $name) ->replyTo($address, $name) ->subject($subject) ->with([ 'data' => $this->data ]); } private function asJSON($data) { $json = json_encode($data); $json = preg_replace('/(["\]}])([,:])(["\[{])/', '$1$2 $3', $json); return $json; } private function asString($data) { $json = $this->asJSON($data); return wordwrap($json, 76, "\n "); } } ``` ================================================ FILE: content/docs/for-developers/sending-email/libraries.md ================================================ --- layout: page weight: 0 title: API Libraries group: open-source seo: title: API Libraries & Clients - SendGrid Documentation | SendGrid override: true description: Send email and interact with SendGrid using your favorite language including Python, Go, Node.js, Ruby, PHP, Java, C#, Perl, Objective-C, and more. navigation: show: true --- These libraries allow quick integration between SendGrid and your project, and are available for a variety of languages and frameworks. ## Official libraries SendGrid maintains the following official libraries for mail sending. - [sendgrid-csharp](https://github.com/sendgrid/sendgrid-csharp) - Official C\# Library - [sendgrid-go](https://github.com/sendgrid/sendgrid-go) - Official Go Library - [sendgrid-java](https://github.com/sendgrid/sendgrid-java) - Official Java Library - [sendgrid-nodejs](https://github.com/sendgrid/sendgrid-nodejs) - Official NodeJS Library - [sendgrid-php](https://github.com/sendgrid/sendgrid-php) - Official PHP Library - [sendgrid-python](https://github.com/sendgrid/sendgrid-python) - Official Python Library - [sendgrid-ruby](https://github.com/sendgrid/sendgrid-ruby) - Official Ruby Library The following official libraries are maintained by SendGrid to create [SMTP API Headers]({{root_url}}/for-developers/sending-email/building-an-smtp-email/), they are included in the above official libraries. - [smtpapi-csharp](https://github.com/sendgrid/smtpapi-csharp) - Official C\# SMTP API library - [smtpapi-go](https://github.com/sendgrid/smtpapi-go) - Official Go SMTP API library - [smtpapi-java](https://github.com/sendgrid/smtpapi-java) - Official Java SMTP API library - [smtpapi-nodejs](https://github.com/sendgrid/smtpapi-nodejs) - Official NodeJS SMTP API library - [smtpapi-php](https://github.com/sendgrid/smtpapi-php) - Official PHP SMTP API library - [smtpapi-python](https://github.com/sendgrid/smtpapi-python) - Official Python SMTP API library - [smtpapi-ruby](https://github.com/sendgrid/smtpapi-ruby) - Official Ruby SMTP API library The following official library is maintained by SendGrid to use the [Event Webhook]({{root_url}}/for-developers/tracking-events/event/): - [EventKit](https://github.com/sendgrid/eventkit-rails) *by SendGrid* - An app to consume and store SendGrid Events. <call-out> If you find a problem with any of the official libraries please submit issues on their respective GitHub projects and we'll address them ASAP </call-out> ## Community libraries Open source library contributions from the awesome SendGrid community. <call-out> If you create a library, please let us know, by editing this page [in our GitHub repo](https://github.com/sendgrid/docs/blob/develop/source/{{page.path}}). </call-out> ## Web API Libraries ### .NET - [StrongGrid](https://github.com/Jericho/StrongGrid) *by Jeremie Desautels* - Strongly typed library (no dynamic types!) for working with SendGrid's v3 API. Available as a [nuget package](https://www.nuget.org/packages/StrongGrid/). This library also includes a parser for Events and Inbounce Email webhooks. - [MinimalSendGrid](https://github.com/TanukiSharp/MinimalSendGrid) *by Sebastien Robert* - Minimal implementation of the SendGrid HTTP v3 API to send emails, compatible with .NET Standard 1.0 - [SendGridSharp](https://github.com/shibayan/SendGridSharp) *by Tatsuro Shibamura* - SendGrid Client for C# (.NET 4.5) Simple interface, support to the new API, there is a feature that is not dependent on the System.Net.Mail. ### Universal - [RapidAPI-SendGrid](https://rapidapi.com/sendgrid/api/SendGrid) *by Dmitry Shumytskyi)* - Test the SendGrid API in your browser and integrate into your app using autogenerated code. - [CloudRail-SendGrid](https://cloudrail.com/?utm_source=SendGrid&utm_medium=Website&utm_campaign=SendGrid%20Website) *by CloudRail* - Bundle SendGrid and other APIs into one SDK ### Android - [sendgrid-android](https://github.com/danysantiago/sendgrid-android) - The Android library for SendGrid by [DannySantiago](https://github.com/danysantiago) - [SendGrid4Android](https://github.com/fredericojssilva/SendGrid4Android) *by Frederico Silva* - Simple SendGrid client for Android ### ColdFusion - [sendgrid.cfc](https://github.com/mjclemente/sendgrid.cfc) - *by Matthew Clemente* - A CFML wrapper for the SendGrid API ### Command Line - [cmdgrid](https://github.com/martyndavies/cmdgrid) *by Martyn Davies* - CLI for working with SendGrid's Parse API - [sgsend](https://github.com/vvaidy/sgsend) *by Vijay Vaidyanathan* - Sending email from the shell command line (for Macs and Unix) - [sg](https://github.com/awwa/sg) *by Wataru Sato* - CLI for all SendGrid v3 endpoints. ### Elixir - [sendgrid_elixir](https://github.com/alexgaribay/sendgrid_elixir) *by Alex Garibay* - Elixir package for sending SendGrid transactional emails - [bamboo](https://github.com/thoughtbot/bamboo) *by Thoughtbot* - Elixir emailing package, with SendGrid adapter - [swoosh](https://github.com/swoosh/swoosh) - Another Elixir emailing package, with SendGrid adapter ### Groovy - [grails-sendgrid](https://github.com/aiten/grails-sendgrid) *by Antony Jones* - Grails framework plugin ### Haskell - [sendgrid-v3](https://github.com/marcelbuesing/sendgrid-v3) *by Marcel Buesing* - Haskell package for sending Mails via the SendGrid v3 Mail API ### Java - [sendgrid-google-java](https://github.com/sendgrid/sendgrid-google-java) *by SendGrid* - Java library for use with Google App Engine - [sendgrid4j](https://github.com/shunjikonishi/sendgrid4j) *by Shunji Konishi* - Simple SendGrid client for Java - [sendgrid-asm-java](https://github.com/krenfro/sendgrid-asm-java) *by Kyle Renfro* - Unsubscribe Groups Java Client ### JavaScript / Node.js - [sendgrid-mailer](https://github.com/adamreisnz) *by Adam Reis* - JavaScript wrapper for the the official SendGrid library. - [node-sendgrid](https://github.com/HerdHound/node-sendgrid) *by Branko Vukelick* - Generate X-SMTPAPI headers in node.js. - [node_subscription_widget](https://github.com/devchas/sendgrid_subscription_widget) *by Devin Chasanoff* - General purpose subscription widget created in node.js - [loopback-sendgrid-connector](https://github.com/VMois/loopback-sendgrid-connector) *by Vladyslav Moisieienkov* - Simple Loopback connector for SendGrid Mail Service - [sts-sendgrid](https://github.com/oritpersik) *by Orit Persik* - Easily use the SendGrid Web API via Node.js. ### Meteor - [meteor-sendgrid](https://github.com/DavidBrear/meteor-sendgrid) *by David Brear* - Meteorite package for SendGrid API ### Perl - [Email::SendGrid::V3](https://metacpan.org/pod/Email::SendGrid::V3) *by Grant Street Group Inc* - Perl library for the SendGrid v3 Web API - [sendgrid-perl](https://github.com/sendgrid/sendgrid-perl) *by SendGrid* - Perl library for the SendGrid v2 API - [WebService--SendGrid](https://github.com/majrmovies/WebService--SendGrid) *by Jonathan Lloyd* - Perl interface for SendGrid v2 API ### PHP - [sendgrid-openshift-php](https://github.com/sendgrid/openshift-sendgrid-php) *by SendGrid* - Official PHP wrapper for use with Red Hat OpenShift - [sendgrid-report-php](https://github.com/fcosrno/sendgrid-report-php) *by Francisco Serrano* - PHP wrapper to view and manage SendGrid reports through the SendGrid API - [SendGrid-PHP-Library](https://github.com/alonbendavid/SendGrid-PHP-Library) *by Alon Ben David* - PHP wrapper for the SendGrid API including Marketing Email API - [messaging_sendgrid](https://github.com/josereyero/messaging_sendgrid) *by Jose Reyero* - Drupal 7 plugin that adds bulk messaging capabilities via SendGrid - [codeigniter-sendgrid-newsletter](https://github.com/bold/codeigniter-sendgrid-newsletter) *by Garrett St John* - CodeIgniter wrapper for the SendGrid Marketing Email API - [codeigniter-sendgrid-mail](https://github.com/bold/codeigniter-sendgrid-mail) *by Garrett St John* - CodeIgniter wrapper for the SendGrid Mail API - [sendgrid-component](https://github.com/damusnet/sendgrid-component) *by Damien Varron* - CakePHP component that extends the base email component with SendGrid functionality - [sendgrid-subuser-api](https://github.com/eliksir/sendgrid-subuser-api) *by Eliksir* - Library that makes it easy to work with the SendGrid Subuser API - [sendgrid-webapi-v3-php](https://github.com/idimensionz/sendgrid-webapi-v3-php) *by iDimensionz* - A complete implementation of the V3 WebAPI in PHP. Very structured, OO implementation with excellent test coverage. A repo containing examples showing how simple it is to utilize our implementation is available at [example](https://github.com/idimensionz/sendgrid-webapi-v3-examples). - [laravel-sendgrid-driver](https://github.com/s-ichikawa/laravel-sendgrid-driver) *by Shingo Ichikawa* - This library can add SendGrid driver into the laravel's mail configure. - [godpod/sendgrid](https://packagist.org/packages/godpod/sendgrid) *by Ravi Rajendra* - This library allows you to quickly and easily send emails or make api calls through SendGrid using PHP. - [fastglass/sendgrid](https://github.com/taz77) *by taz77* - This library allows you to send emails through SendGrid using PHP and Guzzle 6.x. ### PICK BASIC - [MV Connect: MVSendGrid](https://docs.zumasys.com/mv-connect/packages/mvsendgrid/) *by Patrick Payne and Zumasys* - This library allows you to call SendGrid's v2 Web API from various flavors of PICK including but not limited to jBASE, UniVerse, UniData, D3 and OpenQM. ### Python - [greplin-tornado-sendgrid](https://github.com/Cue/greplin-tornado-sendgrid) *by Daniel Gross* - SendGrid client for Tornado Web Server - [django-sendgrid-v5](https://github.com/sklarsa/django-sendgrid-v5/) *by Steven Sklar* - SendGrid Web API Email Backend for Django - [sendgrid-django](https://github.com/elbuo8/sendgrid-django) *by Yamil Asusta* - SendGrid Web API interface for Django - [Flask-SendGrid](https://github.com/frankV/flask-sendgrid) *by Frank Valcarcel* - SendGrid SMTP API interface for Flask - [aiohttp-sendgrid](https://github.com/Kurlov/aiohttp-sendgrid) *by Aleksandr Kurlov* - SendGrid SMTP API interface for aiohttp ### Ruby - [sendgrid](https://github.com/stephenb/sendgrid) *by Stephen Blankenship* - SendGrid rubygem (ActionMailer) - [sendgrid_toolkit](https://github.com/freerobby/sendgrid_toolkit) *by Robby Grossman* - Ruby wrapper for the SendGrid Web API - [sendgrid-rails](https://github.com/PavelTyk/sendgrid-rails) *by Pavel Tsiukhtsiayeu* - Extends ActionMailer with SendGrid methods - [gatling_gun](https://github.com/okrb/gatling_gun) *by James Edward Gray II* - Simple wrapper over SendGrid's Marketing Email API. - [sendgrid_api](https://github.com/markedmondson/sendgrid_api) *by Mark Edmondson* - Implements an ActionMailer that delivers through the SendGrid Web API. - [sendgrid4r](https://github.com/awwa/sendgrid4r) *by Wataru Sato* - Ruby wrapper for the SendGrid Web API v3. ### Rust - [sendgrid-rs](https://github.com/gsquire/sendgrid-rs) by [gsquire](https://github.com/gsquire) ### Titanium - [ti.sendgrid](https://github.com/sendgrid/ti.sendgrid) - SendGrid Titanium wrapper ## Webhook Libraries ### C\# - [StrongGrid](https://github.com/Jericho/StrongGrid) *by Jeremie Desautels* - Strongly typed library (no dynamic types!) for working with SendGrid's v3 API. Available as a [nuget package](https://www.nuget.org/packages/StrongGrid/). This library also includes a parser for Events and Inbounce Email webhooks. - [C# Webhooks](https://github.com/mirajavora/sendgrid-webhooks) - *Community contributed library* ### Python - [Django eventhooks](https://github.com/agiliq/sendgrid-eventhooks) *by agiliq* - An app to consume and store SendGrid Events with Django - [Pyramid Webhooks](https://github.com/GoodRx/pyramid-sendgrid-webhooks) *by GoodRx* - Parses incoming SendGrid Webhook events in Pyramid apps ### Ruby - [gridhook](https://github.com/injekt/gridhook) *by Lee Jarvis* - Ruby Gem for handling inbound batches from our Event API - [griddler](https://github.com/thoughtbot/griddler-sendgrid) *by Thoughtbot* - Rails engine that provides an endpoint for SendGrid's Parse API - [Pokey](https://github.com/ccallebs/pokey-sendgrid) *by Chuck Callebs* - Ruby Gem for simulating events to your code for QA or development environments ## Standard Drivers ### ADO.NET Providers - [CData ADO.NET Provider for SendGrid](http://www.cdata.com/drivers/sendgrid/ado) *by CData Software* - Fully-managed ADO.NET Provider with support for Entity Framework, ADO.NET 2.0, LINQ, and more. Use SendGrid Data Provider objects to connect and access data just as you would access any traditional database. ### JDBC Drivers - [CData JDBC Driver for SendGrid](http://www.cdata.com/drivers/sendgrid/jdbc) *by CData Software* - Pure Java Type 4/5 JDBC Driver with bi-directional access from Java/J2EE applications. Easily connect to live SendGrid data through any JDBC capable application or tool! ### ODBC Drivers - [CData ODBC Driver for SendGrid](http://www.cdata.com/drivers/sendgrid/odbc) *by CData Software* - Unicode-enabled 32/64-bit ODBC 3.8 compliant Driver for Windows, Mac, & Linux. Access SendGrid the same way that you would connect to any other ODBC data source! ================================================ FILE: content/docs/for-developers/sending-email/mailpoet.md ================================================ --- seo: title: How to integrate with MailPoet description: How to integrate with MailPoet keywords: deliverability, wordpress, mailpoet, poet title: How to integrate with MailPoet group: partners weight: 0 layout: page zendesk_id: 204730027 navigation: show: false --- MailPoet is a great way to send mail in WordPress. The best way to get MailPoet to work properly with SendGrid is; 1. Select **Third Party**. 2. Enter in SMTP hostname as `smtp.sendgrid.net`. 3. Enter in your SendGrid username and API key. 4. Select **Use Web API**. ![]({{root_url}}/images/Screen_Shot_2015-02-13_at_4.47.27_PM.png) ================================================ FILE: content/docs/for-developers/sending-email/migrating-from-v2-to-v3-mail-send.md ================================================ --- seo: title: How To Migrate From v2 to v3 Mail Send description: keywords: migration, v2 mail send, v3 mail send, upgrade title: How To Migrate From v2 to v3 Mail Send group: api-v2 weight: 0 layout: page navigation: show: true --- ## Why should you migrate? <call-out> If you are currently using the [Web API v2 mail send endpoint](https://www.twilio.com/docs/sendgrid/api/v2/mail), we recommend that you upgrade to the [latest version](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). </call-out> With a few quick changes you will be able to take advantage of the improvements and added features provided by the v3 mail send endpoint, such as: - Simple, intuitive, and consistent request body format. - Sandbox Mode allows you to test and validate your email. - Improved error reporting and documentation. - Extensive code examples in each of our [libraries]({{root_url}}/for-developers/sending-email/libraries/) to help you integrate quickly. <iframe src="https://player.vimeo.com/video/168940206" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## What do you need to migrate? All you need to migrate from the v2 to v3 mail send endpoint is a SendGrid account. If you are a new SendGrid user and haven’t begun sending email yet, please go straight to our [v3 Mail Send documentation](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) to get started. ## JSON Schema Some of the biggest improvements made to the mail send endpoint reside in the JSON schema used to format and submit the data payload for your email. While the v2 mail send endpoint relies on a combination of JSON and SendGrid’s x-smtpapi headers, all content and metadata sent via the v3 mail send endpoint is defined using JSON within a single request body. Below you will find a visual comparison of the v2 and v3 JSON schemas that highlights equivalent parameters between the 2 versions and any parameters that have been added or removed. Significant additions include the "personalizations", "sandbox_mode", and "bypass_list_management" parameters. For a more detailed discussion of these new parameters, please visit the [v3 Mail Send Overview](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). ![]({{root_url}}/images/v2_vs_v3_mail_send_ga.png) One of the more prominent changes you may notice, is that many of the settings that were previously handled by SendGrid’s [x-smtpapi]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) are now defined explicitly within the JSON schema of the request body to the mail send endpoint. Previously, the only way to specify custom handling instructions for your email was to include individual blocks of JSON for each "setting" or "app" that you wanted to use according to the [SMTP API]({{root_url}}/for-developers/sending-email/building-an-smtp-email/). For example, if you wanted to schedule an email to be sent at a certain time using the v2 mail send endpoint, your request body would look like: ``` api_user=YOUR_USER_NAME& api_key=YOUR_PASSWORD& to=john.doeexampexample@example.com& toname=John& subject=Hello, World!& text=Hello, World!& from=from_address@example.com x-smtpapi={"send_at":1459728000} ``` However, the equivalent API call for the the v3 mail send endpoint would look like: ```json { "personalizations": [ { "to": [ { "email": "john.doeexampexample@example.com" } ], "subject": "Hello, World!", "send_at": 1459728000 } ], "from": { "email": "from_address@example.com" }, "content": { "type": "text/plain", "value": "Hello, World!" } } ``` Notice that while the call to the v2 Mail Send endpoint does include JSON, it is only defined from within the x-smtpapi parameter, whereas the entire payload for the v3 Mail Send API Call is formatted in JSON. ## Requirements and Limitations There are few limitations and requirements differences between the v2 and v3 mail send endpoints, making it even easier to migrate your integration to the latest version. ## Attachments Attachments are handled differently between the v2 and v3 Mail Send endpoints. When attaching files in an email sent over the v2 Mail Send endpoint, you simply needed to attach your file to the transport and specify the file names and content IDs of those files in your API call. Essentially, you specified which files you were attaching in the API call, but the files were actually sent differently. When attaching files to an email sent over the v3 Mail Send endpoint, you must include the BASE64 encoded content of your file, file type, filename, disposition, and content_id for each file you are attaching. These are all defined as separate objects within the `attachments` array. For example, when attaching a single file named "example_file.jpg", the `attachments` object would look like: ```json { "attachments": [ { "content": "[BASE64 encoded content block here]", "type": "jpg", "name": "example_file", "filename": "example_file.jpg", "disposition": "inline", "content_id": "[THE CONTENT ID OF YOUR FILE]" } ] } ``` More Resources For additional resources on the v3 Mail Send endpoint, please first visit our other documentation on the v3 Mail Send endpoint: - [V3 Mail Send Overview](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) - [Upgrading your Authentication to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/) - [SandBox Mode]({{root_url}}/for-developers/sending-email/sandbox-mode/) - [Errors](https://sendgrid.api-docs.io/v3.0/mail-send/mail-send-errors) - [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) - [cURL Examples for Common Use Cases]({{root_url}}/for-developers/sending-email/curl-examples/) You may also visit our [Support page](https://support.sendgrid.com/hc/en-us). ================================================ FILE: content/docs/for-developers/sending-email/modx.md ================================================ --- layout: page weight: 0 title: MODX group: open-source navigation: show: true --- MODX supports sending email over SMTP. To have MODX relay email through SendGrid go to *System Settings \> 'Mail' area* and change: - **SMTP Authentication** - Yes - **SMTP Hosts** - smtp.sendgrid.net - **SMTP Password** - sendgrid_api_key - **SMTP Port** - 587 - **SMTP Connection Prefix** - tls - **SMTP User** - sendgrid_username (use `apikey` for v3 API or later) - **Use SMTP** - Yes The following image shows these settings. ![MODX SMTP with SendGrid]({{root_url}}/images/modx.png "MODX SMTP with SendGrid") ================================================ FILE: content/docs/for-developers/sending-email/outlook-2013.md ================================================ --- layout: page weight: 0 title: Outlook 2013 group: mail-clients navigation: show: true --- These instructions will walk you through how to add an SMTP server to an existing Outlook 2013 setup, but you can also add these settings at the account creation stage. Select **File** and then select **Account and Social Network Settings**. Click **Account Settings**. ![]({{root_url}}/images/outlook_2013_1.png "Account Settings") The 'Account Settings’ window appears. Select the account you receive email through and click **Change**. ![]({{root_url}}/images/outlook_2013_2.png "Change Email") The 'Change E-mail Account’ window appears. This setting (in the red rectangle below) needs to be set for our SMTP address. Outgoing Mail Server smtp.sendgrid.net Under Login Information, please enter your SendGrid username and API key. <call-out> Your SendGrid username may not necessarily be an email address. If your SendGrid username is example_user, enter example_user in the User Name field, not your email address. </call-out> ![]({{root_url}}/images/outlook_2013_3.png "Change Account") Next, click **More Settings** and enter the information as shown below. (Keep in mind you can also use port 25 with no security or 587 with TLS security.) Under the “Outgoing Server Tab”, select **My outgoing server (SMTP) requires authentication**. Click **Log on using** and enter your SendGrid Username and API key. Click **OK** and the 'Change E-mail Account’ window appears. ![]({{root_url}}/images/outlook_2013_4.png "Internet Email Settings") Once you are back on the Change Account screen, click **Next** to test that everything is setup correctly. ![]({{root_url}}/images/outlook_2013_5.png "Click Next") If everything checks out correct then you should see this. ![]({{root_url}}/images/outlook_2013_6.png "All tests completed successfully") You should be all set at this point. If you need more assistance, please [contact support](https://support.sendgrid.com/hc/en-us). ![]({{root_url}}/images/outlook_2013_7.png "Congratulations") ================================================ FILE: content/docs/for-developers/sending-email/outlook.md ================================================ --- layout: page weight: 0 title: Outlook 2007 group: mail-clients navigation: show: true --- These instructions will walk you through how to add an SMTP server to an existing Outlook setup, but you can also add these settings at the account creation stage. Click **Tools** and then select **Account Settings**. ![]({{root_url}}/images/outlook_2007_1.png "Tools_Acctsettings") The 'Account Settings' window appears. Select the account you receive email through and click **Change**. ![]({{root_url}}/images/outlook_2007_2.png "AcctSetEmAccts") The following 'Change E-mail Account' window appears. This setting (in the red rectangle below) needs to be set for our SMTP address. ![]({{root_url}}/images/outlook_2007_3.png "IntMail_Settings") After you are finished, click **More Settings**. The following 'Internet E-mail Settings' window appears. Click **Outgoing Server** and input the settings shown (username and API key are your SendGrid credentials). <call-out> Your SendGrid username may not necessarily be an email address. If your SendGrid username is example_user, enter example_user in the User Name field, not example_user@sendgrid.com. </call-out> ![]({{root_url}}/images/outlook_2007_4.png "IntMail_Settings_2") Next, click **Advanced** and enter the information as shown below. (Keep in mind you can also use port 25 with no security or 587 with TLS security.) ![]({{root_url}}/images/outlook_2007_5.png "IntMail_Settings_3") Click **OK**. You should return to the 'Change E-mail Account' window. Click **Test Account Settings** to verify you are able to receive and send mail successfully. ![]({{root_url}}/images/outlook_2007_6.png "TestSettings") You should see the results below; if you do not, verify your settings are correct. Click **Close** button. ![]({{root_url}}/images/outlook_2007_7.png "CloseTest") Click **Next** and then **Finish** to complete the setup. ![]({{root_url}}/images/outlook_2007_8.png "WizFinish") You are all set to send mail through us. <call-out> Unfortunately, there is not an easy way to add SMTP API headers to a message in Outlook 2007. </call-out> ================================================ FILE: content/docs/for-developers/sending-email/personalizations.md ================================================ --- seo: title: Personalizations description: Learn how to use personalizations to customize your messages sent over the Web API v3. keywords: personalizations, v3 mail send title: Personalizations group: api-v3 weight: 0 layout: page navigation: show: true --- When sending an email with the v3 Mail Send endpoint, you define the various metadata about your message, such as the recipients, sender, subject, and send time, at the root level of a JSON request body. Personalizations allow you to override these various metadata for each email in an API request. Personalizations is an array of objects. Think of the personalizations array like the envelope of a letter: the fields defined within personalizations apply to each email, not the recipient. Like an envelope, personalizations are used to identify who should receive the email as well as details about how you would like the email to be handled. For example, you can define when you would like it to be sent, what headers you would like to include, and any substitutions or custom arguments you would like to be included with the email. Personalizations allow you to define: - "to", "cc", "bcc" - The recipients of your email. - "from" - The sender or _return path_ address of your email. - "subject" - The subject of your email. - "headers" - Any headers you would like to include in your email. - "substitutions" - Any substitutions you would like to be made for your email. - "custom_args" - Any custom arguments you would like to include in your email. - "send_at" - A specific time that you would like your email to be sent. <call-out> You must include at least one `to` object within the personalizations array. </call-out> Since the `personalizations` property is an array, you may include multiple objects allowing you to specify different handling instructions for different copies of your email. For example, you could send the same email to both `john@example.com` and `jane@example.com` but set each email to be delivered at different times. ```json { "from": "sender@yourdomain.com", "template_id": "YOUR TEMPLATE ID", "personalizations": [ { "to": [ { "email": "john@example.com" } ], "send_at": 1600188812 }, { "to": [ { "email": "jane@example.com" } ], "send_at": 1600275471 } ] } ``` <call-out> You may not include more than 1000 personalizations per API request. If you need to include more than 1000 personalizations, please divide these across multiple API requests. </call-out> Some properties can be defined both at the root level of the request body (message level) and at the personalizations level. For example, the `from`, `subject`, `headers`, `custom_arg`, and `send_at` properties can all be defined at the message level or at the personalizations level. Individual fields within the `personalizations` array will override any message level properties that are defined outside of personalizations. For example, the email subject defined within personalizations will override the subject defined at the message level in the JSON payload. Keys within objects such as `custom_args` will be merged. If any of the keys conflict, the keys in the `personalizations` object will replace the message level object’s keys. <call-out> All of the recipients in a single personalization object (specified in the `to`, `cc`, or `bcc` fields) will see the same email, as defined by the data in that personalization. Because of this, SendGrid does not allow duplicate email addresses among these three recipient arrays in a single personalization. </call-out> Below are some examples of how you can use personalizations for various use cases. ## Personalization Examples - [Sending a single email to a single recipient](#sending-a-single-email-to-a-single-recipient) - [Sending a single email to a single recipient with substitutions](#sending-a-single-email-to-a-single-recipient-with-substitutions) - [Sending a single email to a single recipient with a CC](#sending-a-single-email-to-a-single-recipient-with-a-cc) - [Sending a single email to a single recipient with a CC and a BCC](#sending-a-single-email-to-a-single-recipient-with-a-cc-and-a-bcc) - [Sending a single email from a single sender to multiple recipients](#sending-the-same-email-to-multiple-recipients) - [Sending a single email from a single sender to a single recipient with multiple CCs/BCCs](#sending-a-single-email-to-a-single-recipient-with-multiple-ccs/bccs) - [Sending two different emails to two different groups of recipients](#sending-two-different-emails-to-two-different-groups-of-recipients) - [Sending multiple emails from multiple senders to multiple recipients](#sending-multiple-emails-from-multiple-senders-to-multiple-recipients) ### Sending a single email to a single recipient The following example shows you what the personalization property would look like if you wanted to send a single email to a single recipient. ```json { "personalizations": [ { "to": [ { "email": "recipient@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending a single email to a single recipient with substitutions The following example shows you what the personalization property would look like if you wanted to send a single email to a single recipient with substitutions. ```json { "personalizations": [ { "to": [ { "email": "recipient@example.com" } ], "substitutions": { "%fname%": "recipient", "%CustomerID%": "CUSTOMER ID GOES HERE" }, "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending a single email to a single recipient with a CC The following example shows how to send one email to `recipient1@example.com` with a carbon copy sent to `recipient2@example@com`. Both emails will have the same headers. ```json { "personalizations": [ { "to": [ { "email": "recipient1@example.com" } ], "cc": [ { "email": "recipient2@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending a single email to a single recipient with a CC and a BCC The following example shows how to send one email to `recipient1@example.com` with a CC sent to `recipient2@example.com` and a BCC sent to `recipient3@example.com`. ```json { "personalizations": [ { "to": [ { "email": "recipient1@example.com" } ], "cc": [ { "email": "recipient2@example.com" } ], "bcc": [ { "email": "recipient3@example.com" } ] } ] } ``` ### Sending the same email to multiple recipients The following shows how to send one email to three different recipients: `recipient1@example.com`, `recipient2@example.com`, and `recipient3@example.com`. These recipients will all be able to see each other on the email. ```json { "personalizations": [ { "to": [ { "email": "recipient1@example.com" }, { "email": "recipient2@example.com" }, { "email": "recipient3@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending a single email to a single recipient with multiple CCs and BCCs The following shows what personalizations are required to send the same email to one recipient, with multiple CCs and BCCs. ```json { "personalizations": [ { "to": [ { "email": "recipient1@example.com" } ], "cc": [ { "email": "recipient2@example.com" }, { "email": "recipient3@example.com" }, { "email": "recipient4@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending two different emails to two different groups of recipients The following shows how to send two different emails to two different groups of recipients. ```json { "personalizations": [ { "to": [ { "email": "recipient1@example.com" } ], "cc": [ { "email": "recipient2@example.com" }, { "email": "recipient3@example.com" }, { "email": "recipient4@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" }, { "to": [ { "email": "recipient5@example.com" } ], "cc": [ { "email": "recipient6@example.com" }, { "email": "recipient7@example.com" }, { "email": "recipient8@example.com" } ], "subject": "YOUR SUBJECT LINE GOES HERE" } ] } ``` ### Sending multiple emails from multiple senders to multiple recipients It is possible to specify multiple From addresses using personalizations. If a personalization object does not contain a `from` object, SendGrid will use the `email` address in the `from` object defined at the root level of the request body. To successfully deliver email using multiple From addresses, the following conditions must be met. - A `from` object with an `email` property must be specified at the root level of the request body. - The domain of the `from` `email` property specified in any personalization must match the domain of the `from` `email` property specified at root level of the request body—SendGrid will reject requests if these domains do not match. ```json // This is valid { "from": { "email": "support@example.com" }, "personalizations": [ { "from": { "email": "noreply@example.com" } } ] } // This is invalid { "from": { "email": "support@example.com" }, "personalizations": [ { "from": { "email": "noreply@differentexample.com" } } ] } ``` The following shows how to send multiple emails using three different `from` addresses on the same domain. <call-out type="warning"> You must complete [domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) to send email from multiple addresses. SendGrid will reject requests from a sending domain that has not been authenticated. </call-out> ```json { "from": { "email": "default@samedomain.com" }, "personalizations": [ { "subject": "YOUR SUBJECT LINE GOES HERE", "to": [ { "email": "recipient1@example1.com" } ], "from": { "email": "sender1@samedomain.com" } }, { "subject": "YOUR SUBJECT LINE GOES HERE", "to": [ { "email": "recipient2@example2.com" } ], "from": { "email": "sender2@samedomain.com" } }, { "subject": "YOUR SUBJECT LINE GOES HERE", "to": [ { "email": "recipient3@example3.com" } ], "from": { "email": "sender3@samedomain.com" } } ] } ``` ================================================ FILE: content/docs/for-developers/sending-email/phpbb.md ================================================ --- layout: page weight: 0 title: phpBB group: open-source navigation: show: true --- phpBB supports sending email over SMTP. To have phpBB relay email through SendGrid go to *Client Communication \> E-mail settings* in the admin panel and change: - **Use SMTP server for e-mail** - Yes - **SMTP server address:** - smtp.sendgrid.net - **SMTP server port** - 587 - **Authentication method for SMTP** - PLAIN - **SMTP username** - sendgrid_username - **SMTP api_key** - sendgrid_api_key ================================================ FILE: content/docs/for-developers/sending-email/piesync.md ================================================ --- layout: page weight: 0 group: plugins title: Sync your SendGrid contacts using PieSync navigation: show: true seo: title: Sync your SendGrid contacts using PieSync description: Learn how to keep your SendGrid contacts in sync with 100+ other apps using PieSync keywords: integrate, tutorial, contact sync, PieSync, Mailchimp, Zendesk, Salesforce, HubSpot, Quickbooks --- Follow these steps to set up a sync: 1. [Create a PieSync account](#-Create-a-PieSync-account) 2. [Select your apps](#Select-your-apps) 3. [Authorize your apps](#Authorize-your-apps) 4. [Set up your sync configuration](#Set-up-your-sync-configuration) ## Create a PieSync account PieSync is free during a 14 day trial, and is a paid service after. Check beforehand if your app is one of [the many available apps supported by PieSync](https://www.piesync.com/sendgrid). You can sign up for a PieSync account directly [here](https://app.piesync.com/referrer/2gc9v) to get $50 off your first PieSync invoice(s). ## Select your apps Select SendGrid and the app you would like to sync with from within the PieSync application. ## Authorize your apps To authorize, follow the steps as described and make sure you have your [API Key]({{root_url}}/ui/account-and-settings/api-keys/) before getting started. If you have already authorized SendGrid account(s) in the past or have another PieSync integration, you can skip the first part of the authorization and choose from your **Connected Accounts**. ![]({{root_url}}/img/piesync-verify-api-key.png "Verify your SendGrid API Key") ## Set up your sync configuration From within the connection setup screen, you'll be able to manage the following: ### Filters and actions ``` [IF] Supported Conditions/Filters ALREADY EXISTING IN APP YOU SYNC WITH FIELD VALUES (INCLUDING CUSTOM FIELDS) ``` ``` [THEN] Supported Actions UPDATING FIELD VALUES (INCLUDING CUSTOM FIELDS) ``` ![]({{root_url}}/img/piesync-if-then-filters.png "Add then filters") ### Default Mapping Depending on the other app you're syncing with, you'll see a number of standard SendGrid fields being mapped by default. For instance, in a connection with Google Contacts, the default field mapping looks like this: ![]({{root_url}}/img/piesync-default-fields.png "Standard fields") ### Customizable Field Mapping You can custom map your SendGrid Custom Fields and any additional standard fields that aren't included in the default mapping yet. Remember, a mapping between 2 fields can only exist if the types of fields are compatible, and the particular compatibility will determine the direction of the mapping. See our documentation [Customizable Field Mapping](https://help.piesync.com/features/new-customizable-field-mapping) for more information. ![]({{root_url}}/img/piesync-field-mapping.png "Field mapping") ## Additional Resources - [Learn More](https://www.piesync.com/sendgrid/) - [PieSync Help Desk](https://help.piesync.com/connector-apps/send-grid) - [Free PieSync 14-day trial including USD 50 voucher!](https://app.piesync.com/referrer/2gc9v) ================================================ FILE: content/docs/for-developers/sending-email/postfix.md ================================================ --- layout: page weight: 0 title: Postfix group: mail-servers seo: title: Integrate SendGrid with Postfix - SendGrid Documentation | SendGrid description: Setup SendGrid as a Postfix relay host for better deliverability and advanced statistics on your email. navigation: show: true --- Updating the Postfix configuration to use SendGrid as a relay host is easy. For more advanced configuration scenarios, you'll need to refer to the Postfix documentation. <call-out type="warning"> Some implementations of Postfix only allow passwords to contain letters and numbers, meaning you may need to ensure your SendGrid password is only alphanumeric. </call-out> Find your Postfix config file, typically **/etc/postfix/main.cf**, and add the following: ``` smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_tls_security_level = encrypt header_size_limit = 4096000 relayhost = [smtp.sendgrid.net]:587 ``` <call-out> We highly recommend using an API key as your credential for any service that supports it. API keys are both more secure and easier to work with. </call-out> Now you need to specify your credentials (use `apikey` as username and an API Key as password) in the separate file **/etc/postfix/sasl_passwd** (you'll likely need to create it): ``` [smtp.sendgrid.net]:587 apikey:yourSendGridApiKey ``` Next, make sure the file has restricted read and write access only for root, and use the `postmap` command to update Postfix's hashtables to use this new file: ```bash $ sudo chmod 600 /etc/postfix/sasl_passwd $ sudo postmap /etc/postfix/sasl_passwd ``` Finally, restart Postfix: ```bash $ sudo systemctl restart postfix ``` <call-out> If you are getting ***no mechanism available*** error messages, it generally indicates that you are missing some SASL authentication libraries. </call-out> Install the missing module dependency using apt-get (i.e., Debian, Ubuntu): ```bash $ apt-get install libsasl2-modules ``` Or using a yum (i.e., RedHat, Fedora, CentOS): ```bash $ yum install cyrus-sasl-plain ``` ## Troubleshooting If port 587 is not working for you, please try 2525 in your postfix config. You may also need to edit /etc/postfix/master.cf to remove # from `tlsmgr unix - - n 1000? 1 tlsmgr`. For other potential errors, please navigate to the default maillog file on your server for debugging purposes. For a CentOS server, the file is in path /var/log/maillog by default. This file not only reports that the server was unable to use SendGrid to send email but also serves as an excellent debugging tool for new users that catalogues server parameters. ================================================ FILE: content/docs/for-developers/sending-email/qmail.md ================================================ --- layout: page weight: 0 title: Qmail group: mail-servers navigation: show: true --- Qmail does not come with SMTP authentication functionality installed. However you can add [the netqmail TLS+SMTPauth patch](http://notes.sagredo.eu/node/84). Alternately, you can [take a look at Fehcom's very complete description of authentication on mail servers](http://www.fehcom.de/qmail/smtpauth.html), or just jump down to the section about [configuring SMTPAUTH for qmail](https://www.fehcom.de/qmail/smtpauth.html##SETUP). In general, you will need to add the following to **/var/qmail/control/smtproutes**, but you should verify the actual path and file you need to update. ``` :smtp.sendgrid.net:587 username api_key ``` As with all configuration changes, make sure to restart qmail. ================================================ FILE: content/docs/for-developers/sending-email/quickstart-go.md ================================================ --- layout: page weight: 0 title: Email API Quickstart for Go group: api-v3 navigation: show: true seo: title: Email API Quickstart for Go description: Sending your first email using the SendGrid REST API and Go. keywords: Getting Started, API, v3, REST, SendGrid REST API, Go, Golang. --- In this quickstart, you'll learn how to send your first email using the [Twilio SendGrid Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) and [Go](https://golang.org/). ## Prerequisites Be sure to perform the following prerequisites to complete this tutorial. You can skip ahead if you've already completed these tasks. 1. Sign up for a SendGrid account. 2. Enable Two-factor authentication. 3. Create and store a SendGrid API Key with **Mail Send** > **Full Access** permissions. 4. Complete Domain Authentication. 5. Install Go. <a href="#starting-the-project" class="btn btn-primary">Skip the prerequisites</a> ### Sign up for a SendGrid account When you sign up for a free [SendGrid account](https://signup.sendgrid.com/), you'll be able to send 100 emails per day forever. For more account options, see our [pricing page](https://sendgrid.com/pricing/). ### Enable Two-factor authentication Twilio SendGrid requires customers to enable Two-factor authentication (2FA). You can enable 2FA with SMS or by using the [Authy](https://authy.com/) app. See the [2FA section of our authentication documentation]({{root_url}}/for-developers/sending-email/authentication/#two-factor-authentication) for instructions. ### Create and store a SendGrid API key Unlike a username and password — credentials that allow access to your full account — an API key is authorized to perform a limited scope of actions. If your API key is compromised, you can also cycle it (delete and create another) without changing your other account credentials. Visit our [API Key documentation]({{root_url}}/ui/account-and-settings/api-keys/) for instructions on creating an API key and [storing an API key in an environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable). To complete this tutorial, you can create a Restricted Access API key with **Mail Send** > **Full Access** permissions only, which will allow you to send email and schedule emails to be sent later. You can edit the permissions assigned to an API key later to work with additional services. Once your API key is assigned to an environment variable — this quickstart uses `SENDGRID_API_KEY` — you can proceed to the next step. ```shell export SENDGRID_API_KEY=<Your API Key> ``` ### Verify your Sender Identity To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their [Sender Identities]({{root_url}}/for-developers/sending-email/sender-identity/) by completing [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A Sender Identity represents your 'From' email address—the address your recipients see as the sender of your emails. <call-out> To get started quickly, you may be able to skip Domain Authentication and begin by completing [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification). Single Sender Verification is recommended for testing only. Some email providers have [DMARC]({{root_url}}/glossary/dmarc) policies that restrict email from being delivered using their domains. For the best experience, please complete Domain Authentication. Domain Authentication is also required to upgrade from a free account. To better understand why Domain Authentication is necessary, see our ["Spoofing"]({{root_url}}/glossary/spoofing/) and ["Everything about DMARC"]({{root_url}}/ui/sending-email/dmarc/) articles. </call-out> ### Go Before installing Go, you can see if you already have a version on your machine. <call-out> The Twilio SendGrid Go helper library requires Go version 1.7 or later. </call-out> #### Go version check Check your Go version by opening your terminal (also known as a command line, or console) and typing the following command. ```shell go version ``` If you have Go installed, the terminal will print something like the following output. ```shell go version go1.15.7 darwin/amd64 ``` #### Install Go If you do not already have a version of Go installed, visit the [Go website](https://golang.org/dl/) to download and install a version appropriate for your operating system. ## Starting the project Using a [Twilio SendGrid helper library](https://github.com/sendgrid/sendgrid-go) is the fastest way to deliver your first email. Start by creating a project folder for this app. The following examples will use a folder called `sendmail`. ```shell mkdir sendmail ``` Next, navigate into the sendmail directory where you will complete the rest of the tutorial. ```shell cd sendmail ``` This quickstart assumes you are using [Go Modules](https://blog.golang.org/using-go-modules) to manage your Go project and dependencies. If you prefer to use the `$GOPATH` workspace, the Twilio SendGrid helper library will still work, but the project creation steps that follow will differ slightly from your setup. <call-out> There are multiple ways to handle projects and their dependencies when writing Go. Beginning with version 1.11, Go introduced Go Modules as an official dependency management tool. For more information about Go dependencies, see ["Migrating to Go Modules"](https://blog.golang.org/migrating-to-go-modules). </call-out> ### Initialize your project The Go [mod](https://golang.org/ref/mod) package manager is included as part of the Go standard library beginning with version 1.11. You can use the `mod` command to initialize your project. You must pass `mod` a path for your module. The following examples will use `example.com/sendgrid/sendmail`, but you will use the path appropriate for your project. For example, if you intend to store your project on GitHub under the username `sg_gopher`, your path will be `github.com/sg_gopher/sendmail`. ```shell go mod init example.com/sendgrid/sendmail ``` You will now have a `go.mod` file that lists the path for your module and the version of Go used to create it. You will also have a `go.sum` file that stores a cryptographic hash for the content of each dependency in your project. Next, use the `go get` command to install the Twilio SendGrid helper library and save it as a project dependency. ### Install the helper library ```shell go get github.com/sendgrid/sendgrid-go ``` The terminal will print something like the following output. ```shell go: github.com/sendgrid/sendgrid-go upgrade => v3.7.2+incompatible go: finding module for package github.com/sendgrid/rest go: found github.com/sendgrid/rest in github.com/sendgrid/rest v2.6.2+incompatible ``` Your `go.mod` file will now include the Twilio SendGrid `sendgrid-go` and `rest` libraries as project dependencies. ## Send an email You're now ready to write some code. First, create a `main.go` file in your project directory. ### Complete code block The following Go block contains all the code needed in your `main.go` file to successfully deliver a message with the SendGrid Mail Send API. You can copy this code, modify the `to` and `from` variables, and run the code if you like. We'll break down each piece of this code in the following sections. ```go package main import ( "fmt" "log" "os" "github.com/sendgrid/sendgrid-go" "github.com/sendgrid/sendgrid-go/helpers/mail" ) func main() { from := mail.NewEmail("Tira", "tiramisu@example.com") // Change to your verified sender subject := "Sending with Twilio SendGrid is Fun" to := mail.NewEmail("Sou", "souffle@example.com") // Change to your recipient plainTextContent := "and easy to do anywhere, even with Go" htmlContent := "<strong>and easy to do anywhere, even with Go</strong>" message := mail.NewSingleEmail(from, subject, to, plainTextContent, htmlContent) client := sendgrid.NewSendClient(os.Getenv("SENDGRID_API_KEY")) response, err := client.Send(message) if err != nil { log.Println(err) } else { fmt.Println(response.StatusCode) fmt.Println(response.Headers) } } ``` ### Build your API call Your API call must have the following components. - A host (the host for Web API v3 requests is always `https://api.sendgrid.com/v3/`) - An API key passed in an Authorization Header - A request (when submitting data to a resource via `POST` or `PUT`, you must submit your request body in JSON format) In your `main.go` file, set the package to `main`, import the SendGrid helper library, and import the SendGrid mail helper from the library. The library will handle setting the Host, `https://api.sendgrid.com/v3/`, for you. ```go package main import( "github.com/sendgrid/sendgrid-go" "github.com/sendgrid/sendgrid-go/helpers/mail" ) ``` Next, declare a function named `main`. This function is where you will build your email message and make a request to the Twilio SendGrid Mail Send API. ```go func main() { } ``` Now you're ready to set up the `from`, `to`, `subject`, and message body `htmlContent`. These values are passed to the API in a [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) object when using the v3 Mail Send API. You can assign each of these values to variables, and the SendGrid library will handle creating a `personalizations` object for you. Be sure to set the `to` variable to an email address with an inbox you can access. The `subject` and `htmlContent` variables are just strings. However, you will set the `from` and `to` variables using the helper library's `NewEmail` constructor. The `NewEmail` constructor takes two arguments, a `name` and an `address`. <call-out> Notice that there is a `plainTextContent` and an `htmlContent` variable in the full code block. Only one of these values is needed. If you include both variables, only the `htmlContent` value will be used as the body text of your email. </call-out> ```go from := mail.NewEmail("Tira", "tiramisu@example.com") // Change to your verified sender subject = "Sending with SendGrid is Fun" to := mail.NewEmail("Sou", "souffle@example.com") // Change to your recipient htmlContent := "<strong>and easy to do anywhere, even with Go</strong>" ``` To properly construct the message, pass each of the previous variables into the SendGrid library's `NewSingleEmail` function. You can assign this to a variable named `message`. ```go message := mail.NewSingleEmail(from, subject, to, htmlContent) ``` Next, use the API key you set up earlier. Remember, the API key is stored in an environment variable, so you can use the `os.Getenv()` method to access it. This means you also need to import Go's os library. ```go import ( "os" ) ``` Assign the key to a variable named `client` using the helper library's `NewSendClient` method. The helper library will pass your key to the v3 API in an Authorization header using Bearer token authentication. ```go client := sendgrid.NewSendClient(os.Getenv("SENDGRID_API_KEY")) ``` Lastly, you need to make a `POST` request to the SendGrid Mail Send API to deliver your message. The SendGrid helper library provides a `Send` function from [SendGrid's REST library](https://github.com/sendgrid/rest) to make this request. Call the `Send` method on the `client` and pass in your `message` as an argument. ```go # Send an HTTP POST request to /mail/send client.Send(message) ``` You can also print the response status code and headers. Import the fmt and log libraries to do this. You can then assign your `client.Send` call to `response` and `err` variables for logging. ```go import ( "fmt" "log" ) response, err := client.Send(message) if err != nil { log.Println(err) } else { fmt.Println(response.StatusCode) fmt.Println(response.Headers) } ``` With all this code in place, you can run your `main.go` file in your terminal to send the email. ```go go run main.go ``` If you receive a [`202` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) printed to the console, your message was sent successfully. Check the inbox of the `to` address, and you will see your demo message. If you don’t see the email, you may need to check your spam folder. ### Troubleshooting If you receive an error message, you can reference our [response message documentation](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes) for clues about what may have gone wrong. #### API Response messages All responses are returned in JSON format. We specify this by sending the Content-Type header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next Steps This is just the beginning of what you can do with our APIs. To learn more, check the resources below. - [API Reference]({{root_url}}/api-reference/) - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [The Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Twilio SendGrid helper library for Go](https://github.com/sendgrid/sendgrid-go) ================================================ FILE: content/docs/for-developers/sending-email/quickstart-nodejs.md ================================================ --- layout: page weight: 0 title: Email API Quickstart for Node.js group: api-v3 navigation: show: true seo: title: Email API Quickstart for Node.js description: Sending your first email using the SendGrid REST API and Node.js. keywords: Getting Started, API, v3, REST, SendGrid REST API, Node.js, JavaScript --- In this quickstart, you'll learn how to send your first email using the [Twilio SendGrid Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) and [Node.js](https://nodejs.org/). ## Prerequisites Be sure to perform the following prerequisites to complete this tutorial. You can skip ahead if you've already completed these tasks. 1. Sign up for a SendGrid account. 2. Enable Two-factor authentication. 3. Create and store a SendGrid API Key with **Mail Send** > **Full Access** permissions. 4. Complete Domain Authentication. 5. Install Node.js. <a href="#starting-the-project" class="btn btn-primary">Skip the prerequisites</a> ### Sign up for a SendGrid account When you sign up for a free [SendGrid account](https://signup.sendgrid.com/), you'll be able to send 100 emails per day forever. For more account options, see our [pricing page](https://sendgrid.com/pricing/). ### Enable Two-factor authentication Twilio SendGrid requires customers to enable Two-factor authentication (2FA). You can enable 2FA with SMS or by using the [Authy](https://authy.com/) app. See the [2FA section of our authentication documentation]({{root_url}}/for-developers/sending-email/authentication/#two-factor-authentication) for instructions. ### Create and store a SendGrid API key Unlike a username and password — credentials that allow access to your full account — an API key is authorized to perform a limited scope of actions. If your API key is compromised, you can also cycle it (delete and create another) without changing your other account credentials. Visit our [API Key documentation]({{root_url}}/ui/account-and-settings/api-keys/) for instructions on creating an API key and [storing an API key in an environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable). To complete this tutorial, you can create a Restricted Access API key with **Mail Send** > **Full Access** permissions only, which will allow you to send email and schedule emails to be sent later. You can edit the permissions assigned to an API key later to work with additional services. Once your API key is assigned to an environment variable — this quickstart uses `SENDGRID_API_KEY` — you can proceed to the next step. ```shell export SENDGRID_API_KEY=<Your API Key> ``` ### Verify your Sender Identity To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their [Sender Identities]({{root_url}}/for-developers/sending-email/sender-identity/) by completing [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A Sender Identity represents your 'From' email address—the address your recipients see as the sender of your emails. <call-out> To get started quickly, you may be able to skip Domain Authentication and begin by completing [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification). Single Sender Verification is recommended for testing only. Some email providers have [DMARC]({{root_url}}/glossary/dmarc) policies that restrict email from being delivered using their domains. For the best experience, please complete Domain Authentication. Domain Authentication is also required to upgrade from a free account. To better understand why Domain Authentication is necessary, see our ["Spoofing"]({{root_url}}/glossary/spoofing/) and ["Everything about DMARC"]({{root_url}}/ui/sending-email/dmarc/) articles. </call-out> ### Node.js Before installing Node.js, you can see if you already have a version on your machine. <call-out> The Twilio SendGrid Node.js helper library supports the current LTS version of Node.js and versions 6, 7, 8, and 10. </call-out> #### Node.js version check Check your Node.js version by opening your terminal (also known as a command line or console) and typing the following command: ```shell node --version ``` If you have Node.js installed, the terminal should print something like the following output: ```shell v12.16.1 ``` Though the SendGrid helper library supports Node.js back to version 6, we recommend using the latest version. Node.js version 12.16.1 was used to build this quickstart. #### Install Node.js If you do not already have a version of Node.js installed, visit the [Node.js website](https://nodejs.org/en/) for instructions on downloading and installing a version appropriate for your operating system. The npm package manager also has a helpful [installation guide](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm). ## Starting the project Using a [Twilio SendGrid helper library](https://github.com/sendgrid/sendgrid-nodejs) is the fastest way to deliver your first email. Start by creating a project folder for this app. You can name the project anything you like. We use `sgQuickstart` in the following examples. ```shell mkdir sgQuickstart ``` Next, navigate into the sgQuickstart directory where you will complete the rest of the tutorial. ```shell cd sgQuickstart ``` ### Initialize your project The [npm](https://www.npmjs.com/) package manager was included when you installed Node.js. You can use npm to install the Twilio SendGrid helper library as a project dependency. If you want to verify that npm is installed, you can type the following into the terminal. ```shell npm --version ``` The terminal should print something like the following output. ```shell 6.13.4 ``` <call-out> You can install the helper library using [yarn](https://yarnpkg.com/) if you prefer. </call-out> Before installing the package, you should first initialize your project with the following command. ```shell npm init ``` This command will print a chain of questions that help you create a `package.json` file. The `package.json` file stores a list of project dependencies. You can hit **Enter** or **Return** to skip any of the questions and use the default values. Once you complete the initialization process, your package.json will contain a `“main”` property. This property stores the application entry point, which is `"index.js"`. The application entry point is the _main_ file Node.js will look for when running your application code. This will be important later. You can use any file name you want, but we’ll use the default `"index.js"` in this quickstart. ### Install the helper library To install the Twilio SendGrid helper library, type the following command into the terminal. ```shell npm install --save @sendgrid/mail ``` The terminal should print something like. ```shell $npm install --save @sendgrid/mail + @sendgrid/mail@7.2.1 added 15 packages from 19 contributors and audited 15 packages in 1.625s found 0 vulnerabilities ``` <call-out> If you see errors printed above the message, they are likely related to missing information in your package.json file. You can ignore these errors for this quickstart. </call-out> ## How to send an API email You're now ready to write some code. First, create a file in your project directory. Again, you can use `index.js` because that's the name of the `"main"` entry point file in the `package.json` file. ### Complete code block The following Node.js block contains all the code needed to successfully deliver a message with the SendGrid Mail Send API. You can copy this code, modify the `to` and `from` fields, and run the code if you like. We'll break down each piece of this code in the following sections. ```javascript const sgMail = require('@sendgrid/mail') sgMail.setApiKey(process.env.SENDGRID_API_KEY) const msg = { to: 'test@example.com', // Change to your recipient from: 'test@example.com', // Change to your verified sender subject: 'Sending with SendGrid is Fun', text: 'and easy to do anywhere, even with Node.js', html: '<strong>and easy to do anywhere, even with Node.js</strong>', } sgMail .send(msg) .then((response) => { console.log(response[0].statusCode) console.log(response[0].headers) }) .catch((error) => { console.error(error) }) ``` ### Build your API call Your API call must have the following components: - A host (the host for Web API v3 requests is always `https://api.sendgrid.com/v3/`) - An API key passed in an Authorization Header - A request (when submitting data to a resource via `POST` or `PUT`, you must submit your request body in JSON format) In your `index.js` file, require the Node.js helper library. The library will handle setting the Host, `https://api.sendgrid.com/v3/`, for you. ```javascript const sgMail = require('@sendgrid/mail') ``` Next, use the API key you set up earlier. Remember, the API key is stored in an environment variable, so you can use the `process.env()` method to access and assign it using the helper library's `setApiKey()` method. The helper library will pass your key to the API in an Authorization header using Bearer token authentication. ```javascript sgMail.setApiKey(process.env.SENDGRID_API_KEY) ``` Now you're ready to set up your `"to"`, `"from"`, `"subject"`, and message body `"text"`. These values are passed to the API in a ["personalizations"](https://sendgrid.com/docs/for-developers/sending-email/personalizations/) object when using the v3 Mail Send API. The helper library allows you to store all this data in a single flat JavaScript object. Assign the object to a variable named `msg`. Change the `“to”` value to a valid email address you can access. This is where your message will be delivered. Change the `“from”` value to the address you verified during the Sender Identity set up. The `"subject"` can be any text. The email body can be either plain text or HTML. The helper library allows you to specify the type of email body by using either the `"text"` or `"html"` properties. ```javascript const msg = { to: 'test@example.com', // Change to your recipient from: 'test@example.com', // Change to your verified sender subject: 'Sending with SendGrid is Fun', text: 'and easy to do anywhere, even with Node.js', html: '<strong>and easy to do anywhere, even with Node.js</strong>', } ``` To send the message, pass the `msg` object as an argument to the helper library's `send()` method. You can also add `then()` and `catch()` methods to log the response status code and headers or catch and log any errors. ```javascript sgMail .send(msg) .then((response) => { console.log(response[0].statusCode) console.log(response[0].headers) }) .catch((error) => { console.error(error) }) ``` The code block is now complete. To send the message, you can run the `index.js` file with Node.js. ```shell node index.js ``` If you receive a [`202` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) printed to the console, your message was sent successfully. Check the inbox of the `“to”` address, and you should see your demo message. If you don’t see the email, you may need to check your spam folder. ### Troubleshooting If you receive an error message, you can reference our [response message documentation](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes) for clues about what may have gone wrong. #### API Response messages All responses are returned in JSON format. We specify this by sending the Content-Type header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next Steps This is just the beginning of what you can do with our APIs. To learn more, check the resources below. - [API Reference]({{root_url}}/api-reference/) - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [The Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Twilio SendGrid helper library for Node.js](https://github.com/sendgrid/sendgrid-nodejs) ================================================ FILE: content/docs/for-developers/sending-email/quickstart-php.md ================================================ --- layout: page weight: 0 title: Email API Quickstart for PHP group: api-v3 navigation: show: true seo: title: Email API Quickstart for PHP description: Sending your first email using the SendGrid REST API and PHP. keywords: Getting Started, API, v3, REST, SendGrid REST API, PHP --- In this quickstart, you'll learn how to send your first email using [PHP](https://www.php.net/) and the [Twilio SendGrid Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). ## Prerequisites Be sure to perform the following prerequisites to complete this tutorial. You can skip ahead if you've already completed these tasks. 1. Sign up for a SendGrid account. 2. Enable Two-factor authentication. 3. Create and store a SendGrid API key. 4. Complete Domain Authentication. 5. Install PHP. 6. Install Composer. <a href="#starting-the-project" class="btn btn-primary">Skip the prerequisites</a> ### Sign up for a SendGrid account When you sign up for a free [Twilio SendGrid account](https://signup.sendgrid.com/), you'll be able to send 100 emails per day forever. For more account options, see our [pricing page](https://sendgrid.com/pricing/). ### Enable Two-factor authentication Twilio SendGrid requires customers to enable Two-factor authentication (2FA) on their accounts. You can do this either with SMS or by using the [Authy](https://authy.com/) app. See the [2FA section of our authentication documentation]({{root_url}}/for-developers/sending-email/authentication/#two-factor-authentication) for instructions. ### Create and store a SendGrid API key Unlike a username and password — credentials that allow access to your full account — an API key is authorized to perform a limited scope of actions. If your API key is compromised, you can cycle it (delete it and create another one) without changing your other account credentials. Visit our [API Key documentation]({{root_url}}/ui/account-and-settings/api-keys/) for instructions on creating an API key and [storing an API key in an environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable). To complete this tutorial, you can create a **Restricted Access** API key with **Mail Send** > **Full Access** permissions only, which will allow you to send email and schedule emails to be sent later. You can edit the permissions assigned to an API key later to work with additional services. Once your API key is assigned to an environment variable — this quickstart uses `SENDGRID_API_KEY` — you can proceed to the next step. ```shell export SENDGRID_API_KEY=<Your API Key> ``` ### Verify your Sender Identity with Domain Authentication To ensure our customers maintain the best possible sender reputations, and to uphold legitimate sending behavior, Twilio SendGrid requires customers to verify their [Sender Identities]({{root_url}}/for-developers/sending-email/sender-identity/) by completing [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A Sender Identity represents your 'From' email address — the address your recipients see as the sender of your emails. <call-out> To get started quickly, you may be able to skip Domain Authentication and begin by completing [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification). Single Sender Verification is recommended for testing only. Some email providers have [DMARC]({{root_url}}/glossary/dmarc) policies that restrict email from being delivered using their domains. For the best experience, please complete Domain Authentication. Domain Authentication is also required to upgrade from a free account. To better understand why Domain Authentication is necessary, see our ["Spoofing"]({{root_url}}/glossary/spoofing/) and ["Everything about DMARC"]({{root_url}}/ui/sending-email/dmarc/) articles. </call-out> ### PHP Before installing PHP, you can see if you already have a version on your machine. <call-out> The Twilio SendGrid PHP helper library requires PHP version 5.6, 7.0, 7.1, 7.2, 7.3, or 7.4. However, we strongly encourage you to use the latest, stable version, 7.4. </call-out> #### PHP version check Check if you already have a version installed on your machine by opening your terminal (also known as a command line or console) and typing the following command. ```shell php -v ``` If you have PHP installed, the terminal will print something like the following output. ```shell PHP 8.0.3 (cli) (built: Mar 4 2021 20:42:56) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.3, Copyright (c) Zend Technologies with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies ``` <call-out> You may already have a version of PHP included by your operating system. For example, macOS includes a version of PHP; however, you will often want to build your applications with a different version. You can install and manage different versions of PHP on macOS using [Homebrew](https://formulae.brew.sh/formula/php). </call-out> #### Install PHP If you do not already have a version of PHP installed, visit the [PHP website](https://www.php.net/manual/en/install.php) to download and install a version appropriate for your operating system. Alternatively, use your operating system's package manager (such as APT, Yum, Pacman, Ports, or Homebrew) to install the latest supported version of PHP. #### Install Composer See the [Composer installation documentation](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) for download and installation instructions. We recommend installing Composer globally, so that you don't have to install each time you create a new project. To check if you already have it installed, run the following command. ```shell composer --version ``` ## Starting the project With the prerequisites completed, create a project folder for this app by running the following command. ```shell mkdir send_mail ``` Next, navigate into the `send_mail` directory to complete the rest of the tutorial. ```shell cd send_mail ``` ### Initialize your project While you could use an HTTP helper library such as Guzzle or cURL to interact with the Mail Send API, it is far more efficient to use the [SendGrid helper library for PHP](https://github.com/sendgrid/sendgrid-php) instead. To install the SendGrid helper library, run the following Composer command. It will create a `composer.json` file at the root of your project, and install the SendGrid helper library for PHP, along with its dependencies in a new directory named `vendor`. ```shell composer require sendgrid/sendgrid ``` As the command runs, the terminal will print output something like the following example. ```shell Using version ^7.9 for sendgrid/sendgrid ./composer.json has been created Running composer update sendgrid/sendgrid Loading composer repositories with package information Updating dependencies Lock file operations: 3 installs, 0 updates, 0 removals - Locking sendgrid/php-http-client (3.14.0) - Locking sendgrid/sendgrid (7.9.2) - Locking starkbank/ecdsa (0.0.4) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 3 installs, 0 updates, 0 removals - Downloading sendgrid/php-http-client (3.14.0) - Installing starkbank/ecdsa (0.0.4): Extracting archive - Installing sendgrid/php-http-client (3.14.0): Extracting archive - Installing sendgrid/sendgrid (7.9.2): Extracting archive 1 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files ``` ## Send an email You're now ready to write some code to send your first email. Start by creating a new PHP file named `send_mail.php` in the root of your project directory. ### Complete code block The following PHP block contains all the code needed in your `send_mail.php` file to successfully deliver a message with the Twilio SendGrid Mail Send API. You can copy this code to the `send_mail.php` file, modify the values passed to the `setFrom` and `addTo` methods, and run the code to see what happens. We'll break down each piece of this code in the following sections. ```php <?php declare(strict_types=1); require 'vendor/autoload.php'; use \SendGrid\Mail\Mail; $email = new Mail(); // Replace the email address and name with your verified sender $email->setFrom( 'test@example.com', 'Example Recipient' ); $email->setSubject('Sending with Twilio SendGrid is Fun'); // Replace the email address and name with your recipient $email->addTo( 'test@example.com', 'Example Sender' ); $email->addContent( 'text/html', '<strong>and easy to do anywhere, even with PHP</strong>' ); $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY')); try { $response = $sendgrid->send($email); printf("Response status: %d\n\n", $response->statusCode()); $headers = array_filter($response->headers()); echo "Response Headers\n\n"; foreach ($headers as $header) { echo '- ' . $header . "\n"; } } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage() ."\n"; } ``` ### Build your API call Your API call must have the following components. The helper library abstracts this away, reducing the code you must write. - A host (the host for Web API v3 requests is always `https://api.sendgrid.com/v3/`) - An API key passed in an Authorization Header - A request (when submitting data to a resource via `POST` or `PUT`, you must submit your request body in JSON format) The code starts by loading [Composer's autoloader](https://medium.com/tech-tajawal/php-composer-the-autoloader-d676a2f103aa), which makes all of the required classes available to our code. ```php require 'vendor/autoload.php' ``` It then initializes a new variable, `$email`, as an instance of the library's `Mail` class. ```php $email = new Mail(); ``` The code then sets the message's sender, subject, recipient, and content using the `setFrom`, `setSubject`, `addTo`, and `addContent` methods. The values passed to these methods are formatted and sent to the API in a [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) object when using the v3 Mail Send API. The `setSubject` method accepts a string. The `setFrom` and `addTo` methods accept an email address and an optional sender name as strings. Be sure to assign `addTo` an address with an inbox that you can access. The `addContent` method takes the message's type, which can be either `text/plain` or `text/html`, and a string value, which is the content you wish to send in the message body. ```php // Replace with your verified sender $email->setFrom( 'test@example.com', 'Example Recipient' ); $email->setSubject( 'Sending with Twilio SendGrid is Fun' ); // Replace with your recipient $email->addTo( 'test@example.com', 'Example Sender' ); $email->addContent( 'text/html', '<strong>and easy to do anywhere, even with PHP</strong>' ); ``` With the message object initialized, a new variable, `$sendgrid`, is initialized, which provides the ability to send the message. This variable is a `SendGrid` object. The `SendGrid` class accepts two arguments: your API key and an options array. You need to pass in your API key only, which the code does using [PHP's `getenv` method](https://www.php.net/manual/en/function.getenv.php). The helper library will handle setting the host, constructing your personalizations object, and formatting the message for you. ```php $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY')); ``` Lastly, the code calls the `$sendgrid` `send` method, to which you pass your `$email`. This method makes a request to the Mail Send API to deliver the email message, assigning the response to a variable, aptly, named `$response`. ```php $response = $sendgrid->send($email); ``` With all the code in place, run the `send_mail.php` file in your terminal to send the email using the command below. ```php php send_mail.php ``` You can also wrap your API call in a try block to print the status code and headers of the response or log exceptions in the try block's corresponding catch block. ```php try { $response = $sendgrid->send($email); print $response->statusCode() . "\n"; print_r($response->headers()); } catch (Exception $e) { echo 'Caught exception: '. $e->getMessage() ."\n"; } ``` If a [`202` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) is printed to the console, your message was sent successfully. Check the inbox of the `addTo` address, and you will see your demo message. If you don’t see the email, check your spam folder. ### Troubleshooting If you receive an error message, you can reference our [response message documentation](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes) for clues about what may have gone wrong. #### API Response messages All responses are returned in JSON format. We specify this by sending the Content-Type Header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next Steps This is just the beginning of what you can do with our APIs. To learn more, check the resources below. - [API Reference]({{root_url}}/api-reference/) - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [The Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Twilio SendGrid helper library for PHP](https://github.com/sendgrid/sendgrid-php) ================================================ FILE: content/docs/for-developers/sending-email/quickstart-python.md ================================================ --- layout: page weight: 0 title: Email API Quickstart for Python group: api-v3 navigation: show: true seo: title: Email API Quickstart for Python description: Sending your first email using the SendGrid REST API and Python. keywords: Getting Started, API, v3, REST, SendGrid REST API, Python, Python 3. --- In this quickstart, you'll learn how to send your first email using the [Twilio SendGrid Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) and [Python](https://www.python.org/). ## Prerequisites Be sure to perform the following prerequisites to complete this tutorial. You can skip ahead if you've already completed these tasks. 1. Sign up for a SendGrid account. 2. Enable Two-factor authentication. 3. Create and store a SendGrid API Key with **Mail Send** > **Full Access** permissions. 4. Complete Domain Authentication. 5. Install Python. <a href="#starting-the-project" class="btn btn-primary">Skip the prerequisites</a> ### Sign up for a SendGrid account When you sign up for a free [SendGrid account](https://signup.sendgrid.com/), you'll be able to send 100 emails per day forever. For more account options, see our [pricing page](https://sendgrid.com/pricing/). ### Enable Two-factor authentication Twilio SendGrid requires customers to enable Two-factor authentication (2FA). You can enable 2FA with SMS or by using the [Authy](https://authy.com/) app. See the [2FA section of our authentication documentation]({{root_url}}/for-developers/sending-email/authentication/#two-factor-authentication) for instructions. ### Create and store a SendGrid API key Unlike a username and password — credentials that allow access to your full account — an API key is authorized to perform a limited scope of actions. If your API key is compromised, you can also cycle it (delete and create another) without changing your other account credentials. Visit our [API Key documentation]({{root_url}}/ui/account-and-settings/api-keys/) for instructions on creating an API key and [storing an API key in an environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable). To complete this tutorial, you can create a Restricted Access API key with **Mail Send** > **Full Access** permissions only, which will allow you to send email and schedule emails to be sent later. You can edit the permissions assigned to an API key later to work with additional services. Once your API key is assigned to an environment variable — this quickstart uses `SENDGRID_API_KEY` — you can proceed to the next step. ```shell export SENDGRID_API_KEY=<Your API Key> ``` ### Verify your Sender Identity To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their [Sender Identities]({{root_url}}/for-developers/sending-email/sender-identity/) by completing [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A Sender Identity represents your 'From' email address—the address your recipients see as the sender of your emails. <call-out> To get started quickly, you may be able to skip Domain Authentication and begin by completing [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification). Single Sender Verification is recommended for testing only. Some email providers have [DMARC]({{root_url}}/glossary/dmarc) policies that restrict email from being delivered using their domains. For the best experience, please complete Domain Authentication. Domain Authentication is also required to upgrade from a free account. To better understand why Domain Authentication is necessary, see our ["Spoofing"]({{root_url}}/glossary/spoofing/) and ["Everything about DMARC"]({{root_url}}/ui/sending-email/dmarc/) articles. </call-out> ### Python Before installing Python, you can see if you already have a version on your machine. <call-out> The Twilio SendGrid Python helper library supports Python 2.7, 3.5, 3.6, 3.7, and 3.8. </call-out> #### Python version check Check your Python version by opening your terminal (also known as a command line or console) and typing the following command. ```shell python --version ``` If you have Python installed, the terminal should print something like the following output. ```shell Python 3.8.5 ``` <call-out> Though the SendGrid helper library supports Python back to version 2.7, we recommend using a 3.x version now that Python 2 has reached end-of-life status. It is possible to have multiple versions of Python on your computer. Some operating systems come with a version of Python already installed. If you run `python --version` and receive `Python 2.7.x` after installing Python 3, try running `python3 --version` to see which 3.x version of Python you have installed. This tutorial will use the `python` command, assuming you are working with Python 3. If you have not set up Python 3 in a virtual environment, you may need to run the command `python3` instead. For more about running multiple versions of Python, see ["Virtual Environments and Packages"](https://docs.python.org/3/tutorial/venv.html) in the Python documentation. </call-out> #### Install Python If you do not already have a version of Python installed, visit the [Python website](https://www.python.org/downloads) to download and install a version appropriate for your operating system. ## Starting the project Using a [Twilio SendGrid helper library](https://github.com/sendgrid/sendgrid-python) is the fastest way to deliver your first email. Start by creating a project folder for this app. You can name the project anything you like. We use `sg_quickstart` in the following examples. ```shell mkdir sg_quickstart ``` Next, navigate into the sg_quickstart directory where you will complete the rest of the tutorial. ```shell cd sg_quickstart ``` ### Initialize your project The [pip](https://pypi.org/project/pip/) package manager was included when you installed Python. You can use pip to install the Twilio SendGrid helper library and save it as a project dependency. If you want to verify that pip is installed, you can type the following into the terminal. ```shell pip --version ``` The terminal should print something like the following output. ```shell pip 20.1.1 from /usr/locallib/python3.8/site-packages/pip (python 3.8) ``` <call-out> If you do not have a version of pip installed, you can download and install it using the [pip installation instructions on python.org](https://packaging.python.org/tutorials/installing-packages/). </call-out> ### Install the helper library To install the Twilio SendGrid helper library, type the following command into the terminal. ```shell pip install sendgrid ``` The terminal should print something like. ```shell Collecting sendgrid Using cached sendgrid-6.4.6-py3-none-any.whl (73 kB) Requirement already satisfied: python-http-client>=3.2.1 in /usr/local/lib/python3.8/site-packages (from sendgrid) (3.3.1) Requirement already satisfied: starkbank-ecdsa>=1.0.0 in /usr/local/lib/python3.8/site-packages (from sendgrid) (1.0.0) Installing collected packages: sendgrid Successfully installed sendgrid-6.4.6 ``` ## How to send an API email You're now ready to write some code. First, create a file in your project directory. You can use `app.py`. ### Complete code block The following Python block contains all the code needed to successfully deliver a message with the SendGrid Mail Send API. You can copy this code, modify the `from_email` and `to_email` variables, and run the code if you like. We'll break down each piece of this code in the following sections. ```python import sendgrid import os from sendgrid.helpers.mail import Mail, Email, To, Content sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY')) from_email = Email("test@example.com") # Change to your verified sender to_email = To("test@example.com") # Change to your recipient subject = "Sending with SendGrid is Fun" content = Content("text/plain", "and easy to do anywhere, even with Python") mail = Mail(from_email, to_email, subject, content) # Get a JSON-ready representation of the Mail object mail_json = mail.get() # Send an HTTP POST request to /mail/send response = sg.client.mail.send.post(request_body=mail_json) print(response.status_code) print(response.headers) ``` ### Build your API call Your API call must have the following components: - A host (the host for Web API v3 requests is always `https://api.sendgrid.com/v3/`) - An API key passed in an Authorization Header - A request (when submitting data to a resource via `POST` or `PUT`, you must submit your request body in JSON format) In your `app.py` file, import the SendGrid helper library. The library will handle setting the Host, `https://api.sendgrid.com/v3/`, for you. ```python import sendgrid ``` Next, use the API key you set up earlier. Remember, the API key is stored in an environment variable, so you can use the `os.environ.get()` method to access it. This means we also need to import Python's os library. ```python import os ``` Assign the key to a variable named `sg` using the helper library's `SendGridAPIClient()` method. The helper library will pass your key to the v3 API in an Authorization header using Bearer token authentication. ```python sg = sendgrid.SendGridAPIClient(api_key = os.environ.get('SENDGRID_API_KEY')) ``` Now you're ready to set up the `from_email`, `to_email`, `subject`, and message body `content`. These values are passed to the API in a ["personalizations"]({{root_url}}/for-developers/sending-email/personalizations/) object when using the v3 Mail Send API. You can assign each of these values to variables, and the SendGrid library will handle creating a personalizations object for you. First, import the library's `Mail`, `Email`, `To`, and `Content` classes. ```python from sendgrid.helpers.mail import Mail, Email, To, Content ``` With the helpers imported, define and assign values for `from_email`, `to_email`, `subject`, and `content` variables. Assigning an email address like `from_email = "sender@example.com"` will work. However, the constructors imported in the previous step allow you to pass data to them to be sure your final message is formatted properly. Be sure to assign the `to_email` to an address with an inbox you can access. Note that the `Content()` helper takes two arguments: the content type and the content itself. You have two options for the content type: `text/plain` or `text/html`. The second parameter will take the plain text or HTML content you wish to send. ```python from_email = Email("test@example.com") # Change to your verified sender to_email = To("test@example.com") # Change to your recipient subject = "Sending with SendGrid is Fun" content = Content("text/plain", "and easy to do anywhere, even with Python") ``` To properly construct the message, pass each of the previous variables into the SendGrid library's Mail constructor. You can assign this to a variable named `mail`. You can then use the the Mail constructor's `get()` method to get a JSON-ready representation of the Mail object. ```python mail = Mail(from_email, to_email, subject, content) # Get a JSON-ready representation of the Mail object mail_json = mail.get() ``` Lastly, you need to make a request to the SendGrid Mail Send API to deliver your message. The helper library uses SendGrid's [python-http-client](https://github.com/sendgrid/python-http-client) library to construct the request URL by chaining together portions of your desired path. The path to the SendGrid v3 Mail Send endpoint is `https://api.sendgrid.com/v3/mail/send`. The helper library sets the client for you, so the `https://api.sendgrid.com/v3` portion is taken care of by typing `sg.client`. The next parts of the path are `/mail` and `/send`. You can chain the the words `mail` and `send` onto `client` to build the rest of the URL. With the URL built, python-http-client then allows you to chain on the type of HTTP request you wish to make with a method matching the name of the HTTP verb appropriate for your desired endpoint. To send a message, you should make an HTTP `POST` request, so you can use `post()`. The `post()` method takes a `request_body`, which you should set to the JSON version of your message (remember, this JSON-ready version is stored in the `mail_json` variable). You can assign this full call to a variable named `response` and print the response status code and headers. ```python # Send an HTTP POST request to /mail/send response = sg.client.mail.send.post(request_body=mail_json) print(response.status_code) print(response.headers) ``` With all this code in place, you can run your `app.py` file with Python to send the email. ```shell python app.py ``` If you receive a [`202` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) printed to the console, your message was sent successfully. Check the inbox of the `“to_email”` address, and you should see your demo message. If you don’t see the email, you may need to check your spam folder. ### Troubleshooting If you receive an error message, you can reference our [response message documentation](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes) for clues about what may have gone wrong. #### API Response messages All responses are returned in JSON format. We specify this by sending the Content-Type header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next Steps This is just the beginning of what you can do with our APIs. To learn more, check the resources below. - [API Reference]({{root_url}}/api-reference/) - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [The Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Twilio SendGrid helper library for Python](https://github.com/sendgrid/sendgrid-python) ================================================ FILE: content/docs/for-developers/sending-email/quickstart-ruby.md ================================================ --- layout: page weight: 0 title: Email API Quickstart for Ruby group: api-v3 navigation: show: true seo: title: Email API Quickstart for Ruby description: Sending your first email using the SendGrid REST API and Ruby. keywords: Getting Started, API, v3, REST, SendGrid REST API, Ruby. --- In this quickstart, you'll learn how to send your first email using the [Twilio SendGrid Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) and [Ruby](https://www.ruby-lang.org/en/). ## Prerequisites Be sure to perform the following prerequisites to complete this tutorial. You can skip ahead if you've already completed these tasks. 1. Sign up for a SendGrid account. 2. Enable Two-factor authentication. 3. Create and store a SendGrid API Key with **Mail Send** > **Full Access** permissions. 4. Complete Domain Authentication. 5. Install Ruby. <a href="#starting-the-project" class="btn btn-primary">Skip the prerequisites</a> ### Sign up for a SendGrid account When you sign up for a free [SendGrid account](https://signup.sendgrid.com/), you'll be able to send 100 emails per day forever. For more account options, see our [pricing page](https://sendgrid.com/pricing/). ### Enable Two-factor authentication Twilio SendGrid requires customers to enable Two-factor authentication (2FA). You can enable 2FA with SMS or by using the [Authy](https://authy.com/) app. See the [2FA section of our authentication documentation]({{root_url}}/for-developers/sending-email/authentication/#two-factor-authentication) for instructions. ### Create and store a SendGrid API key Unlike a username and password — credentials that allow access to your full account — an API key is authorized to perform a limited scope of actions. If your API key is compromised, you can also cycle it (delete and create another) without changing your other account credentials. Visit our [API Key documentation]({{root_url}}/ui/account-and-settings/api-keys/) for instructions on creating an API key and [storing an API key in an environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable). To complete this tutorial, you can create a Restricted Access API key with **Mail Send** > **Full Access** permissions only, which will allow you to send email and schedule emails to be sent later. You can edit the permissions assigned to an API key later to work with additional services. Once your API key is assigned to an environment variable — this quickstart uses `SENDGRID_API_KEY` — you can proceed to the next step. ```shell export SENDGRID_API_KEY=<Your API Key> ``` ### Verify your Sender Identity To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their [Sender Identities]({{root_url}}/for-developers/sending-email/sender-identity/) by completing [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A Sender Identity represents your 'From' email address—the address your recipients see as the sender of your emails. <call-out> To get started quickly, you may be able to skip Domain Authentication and begin by completing [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification). Single Sender Verification is recommended for testing only. Some email providers have [DMARC]({{root_url}}/glossary/dmarc) policies that restrict email from being delivered using their domains. For the best experience, please complete Domain Authentication. Domain Authentication is also required to upgrade from a free account. To better understand why Domain Authentication is necessary, see our ["Spoofing"]({{root_url}}/glossary/spoofing/) and ["Everything about DMARC"]({{root_url}}/ui/sending-email/dmarc/) articles. </call-out> ### Ruby Before installing Ruby, you can see if you already have a version on your machine. <call-out> The Twilio SendGrid Ruby helper library supports Ruby versions 2.4 through the current version of Ruby 2.x, [excluding version 2.6.0](https://github.com/sendgrid/sendgrid-ruby/blob/main/TROUBLESHOOTING.md#ruby-versions). </call-out> #### Ruby version check Check your Ruby version by opening your terminal (also known as a command line or console) and typing the following command. ```shell ruby -v ``` If you have Ruby installed, the terminal will print something like the following output. ```shell ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19] ``` <call-out> You may already have a version of Ruby included on your operating system. For example, MacOS includes a version of Ruby for its own system uses. [It is not recommended to develop your application using the MacOS system installation of Ruby](https://www.freecodecamp.org/news/do-not-use-mac-system-ruby-do-this-instead/). You can use a version manager such as rbenv or rvm to manage multiple versions of Ruby on one machine. See the [rbenv](https://github.com/rbenv/rbenv) and [RVM](https://rvm.io/) projects for more information. </call-out> #### Install Ruby If you do not already have a version of Ruby installed, visit the [Ruby website](https://www.ruby-lang.org/en/documentation/installation/) to download and install a version appropriate for your operating system. ## Starting the project Using a [Twilio SendGrid helper library](https://github.com/sendgrid/sendgrid-ruby) is the fastest way to deliver your first email. Start by creating a project folder for this app. The following examples will use a folder called `send_mail`. ```shell mkdir send_mail ``` Next, navigate into the `send_mail` directory where you will complete the rest of the tutorial. ```shell cd send_mail ``` ### Initialize your project The [RubyGems](https://rubygems.org/) package manager is included when installing Ruby. You can use RubyGems to install the Twilio SendGrid helper library and save it as a project dependency. If you want to verify that RubyGems is installed, you can type the following into the terminal. ```shell gem -v ``` The terminal should print something like the following output. ```shell 3.1.4 ``` ### Install the helper library To install the Twilio SendGrid helper library, type the following command into the terminal. ```shell gem install sendgrid-ruby ``` The terminal will output something like the following output. ```shell Fetching ruby_http_client-3.5.2.gem Fetching sendgrid-ruby-6.4.0.gem Successfully installed ruby_http_client-3.5.2 Successfully installed sendgrid-ruby-6.4.0 Parsing documentation for ruby_http_client-3.5.2 Installing ri documentation for ruby_http_client-3.5.2 Parsing documentation for sendgrid-ruby-6.4.0 Installing ri documentation for sendgrid-ruby-6.4.0 Done installing documentation for ruby_http_client, sendgrid-ruby after 0 seconds 2 gems installed ``` ## Send an email You're now ready to write some code. First, create a `send_mail.rb` file in your project directory. ### Complete code block The following Ruby block contains all the code needed in your `send_mail.rb` file to successfully deliver a message with the SendGrid Mail Send API. You can copy this code, modify the `to` and `from` variables, and run the code if you like. We'll break down each piece of this code in the following sections. ```ruby require 'sendgrid-ruby' include SendGrid from = SendGrid::Email.new(email: 'test@example.com', name: "Test") # Change to your verified sender to = SendGrid::Email.new(email: 'test@example.com', name: "Test") # Change to your recipient subject = 'Sending with Twilio SendGrid is Fun' content = SendGrid::Content.new(type: 'text/html', value: 'and easy to do anywhere, even with <strong>Ruby</strong>.') mail = SendGrid::Mail.new(from, subject, to, content) sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) response = sg.client.mail._('send').post(request_body: mail.to_json) puts response.status_code puts response.headers ``` ### Build your API call Your API call must have the following components. - A host (the host for Web API v3 requests is always `https://api.sendgrid.com/v3/`) - An API key passed in an Authorization Header - A request (when submitting data to a resource via `POST` or `PUT`, you must submit your request body in JSON format) In your `send_mail.rb` file, require the SendGrid helper library, and include the SendGrid module. The library will handle setting the Host, `https://api.sendgrid.com/v3/`, for you. ```ruby require 'sendgrid-ruby' include SendGrid ``` Now you're ready to set up the `from`, `to`, `subject`, and message body `content`. These values are passed to the API in a [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) object when using the v3 Mail Send API. You can assign each of these values to variables, and the SendGrid library will handle creating a `personalizations` object for you. The `subject` variable is a string. However, you will set the `from` and `to` variables using the helper library's `Email` method. The `Email` method takes two arguments: an optional `name` and an `email` address. Be sure to set the `to` value to an address with an inbox you can access. The `content` variable is set with the `Content` method. The `Content` method takes a `type`, which can be either `text/plain` or `text/html`, and a `value`, which is a string of the content you wish to send in the message body. ```ruby from = SendGrid::Email.new(email: 'test@example.com', name: "Test") # Change to your verified sender to = SendGrid::Email.new(email: 'test@example.com', name: "Test") # Change to your recipient subject = 'Sending with Twilio SendGrid is Fun' content = SendGrid::Content.new(type: 'text/html', value: 'and easy to do anywhere, even with <strong>Ruby</strong>.') ``` To properly construct the message, pass each of the previous variables into the SendGrid library's `Mail` method. You can assign this to a variable named `mail`. ```ruby mail = SendGrid::Mail.new(from, subject, to, content) ``` Next, use the API key you set up earlier. Remember, the API key is stored in an environment variable, so you can use Ruby's `ENV` class to access it. Assign the key to a variable named `sg` using the helper library's `API` method. The helper library will pass your key to the v3 API in an Authorization Header using Bearer token authentication. ```ruby sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) ``` Lastly, you need to make a request to the SendGrid Mail Send API to deliver your message. The helper library uses SendGrid's [ruby-http-client](https://github.com/sendgrid/ruby-http-client) library to construct the request URL by chaining together portions of your desired path. The path to the SendGrid v3 Mail Send endpoint is `https://api.sendgrid.com/v3/mail/send`. The helper library sets the client for you, so the `https://api.sendgrid.com/v3` portion is taken care of by typing `sg.client`. The next parts of the path are `/mail` and `/send`. You can chain the words `mail` and `send` onto `client` to build the rest of the URL. With the URL built, `ruby-http-client` then allows you to chain on the type of HTTP request you wish to make with a method matching the name of the HTTP verb appropriate for your desired endpoint. To send a message, you should make an HTTP `POST` request, so you can use `post()`. The `post()` method takes a `request_body`, which you should set to a JSON version of your message. You can assign this full call to a variable named `response`. You can also print the response status code and headers. ```ruby # Send an HTTP POST request to /mail/send response = sg.client.mail._('send').post(request_body: mail.to_json) puts response.status_code puts response.headers ``` With all this code in place, you can run your `mail_send.rb` file in your terminal to send the email. ```shell ruby mail_send.rb ``` If you receive a [`202` status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202) printed to the console, your message was sent successfully. Check the inbox of the `to` address, and you will see your demo message. If you don’t see the email, you may need to check your spam folder. ### Troubleshooting If you receive an error message, you can reference our [response message documentation](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes) for clues about what may have gone wrong. #### API Response messages All responses are returned in JSON format. We specify this by sending the Content-Type Header. The Web API v3 provides a selection of [response codes](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#status-codes), [content-type headers](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#content-type-header), and [pagination](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-responses#pagination) options to help you interpret the responses to your API requests. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Next Steps This is just the beginning of what you can do with our APIs. To learn more, check the resources below. - [API Reference]({{root_url}}/api-reference/) - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [The Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Sender Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Twilio SendGrid helper library for Ruby](https://github.com/sendgrid/sendgrid-ruby) ================================================ FILE: content/docs/for-developers/sending-email/rubyonrails.md ================================================ --- layout: page weight: 0 group: frameworks title: Ruby on Rails seo: title: Send Email with Ruby on Rails description: View instructions on how to easily send email with Ruby on Rails using SendGrid, by setting up setting up ActionMailer or using a gem. navigation: show: true --- This example shows how to send an email for user signups. You can also checkout <a href='https://github.com/sendgrid/sendgrid-ruby'>this gem</a> for more advanced features. ## Setup ActionMailer Let's generate a Mailer class. Mailer classes function as our controllers for email views. ``` bash $ rails generate mailer UserNotifierMailer ``` Now we open up the mailer we've just generated, `app/mailers/user_notifier_mailer.rb` and add a mailer action that sends users a signup email. ``` ruby class UserNotifierMailer < ApplicationMailer default :from => 'any_from_address@example.com' # send a signup email to the user, pass in the user object that contains the user's email address def send_signup_email(user) @user = user mail( :to => @user.email, :subject => 'Thanks for signing up for our amazing app' ) end end ``` Now we need a view that corresponds to our action and outputs HTML for our email. Create a file `app/views/user_notifier_mailer/send_signup_email.html.erb` as follows: ``` html <!DOCTYPE html> <html> <head> <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' /> </head> <body> <h1>Thanks for signing up, <%= @user.name %>!</h1> <p>Thanks for joining and have a great day! Now sign in and do awesome things!</p> </body> </html> ``` If you don't have a user model quite yet, generate one quickly. ``` bash $ rails generate scaffold user name email login $ rake db:migrate ``` Now in the controller for the user model `app/controllers/users_controller.rb`, add a call to `UserNotifierMailer.send_signup_email` when a user is saved. ``` ruby class UsersController < ApplicationController def create # Create the user from params @user = User.new(user_params) if @user.save # Deliver the signup email UserNotifierMailer.send_signup_email(@user).deliver redirect_to(@user, :notice => 'User created') else render :action => 'new' end end private def user_params params.require(:user).permit(:name, :email, :login) end end ``` Alright, now we're cooking! Let's get it all going through SendGrid. ## Configure ActionMailer to Use SendGrid In `config/environment.rb` specify your ActionMailer settings to point to SendGrid's servers. ``` ruby ActionMailer::Base.smtp_settings = { :user_name => 'apikey', # This is the string literal 'apikey', NOT the ID of your API key :password => '<SENDGRID_API_KEY>', # This is the secret sendgrid API key which was issued during API key creation :domain => 'yourdomain.com', :address => 'smtp.sendgrid.net', :port => 587, :authentication => :plain, :enable_starttls_auto => true } ``` That's it! When a new user object is saved, an email will be sent to the user via SendGrid. <call-out type="warning"> As a best practice, you should not store your credentials directly in the source but should instead store them in configuration files or environment variables. See this tutorial on <a href='http://railsapps.github.io/rails-environment-variables.html'>environment variables in Rails</a>. And for Rails Versions 5.2+ see <a href='https://guides.rubyonrails.org/security.html#custom-credentials'>Securely storing custom credentials in Rails.</a> </call-out> ================================================ FILE: content/docs/for-developers/sending-email/sandbox-mode.md ================================================ --- seo: title: Sandbox Mode description: Learn how to use Sandbox Mode when sending mail over SendGrid's Web API v3. keywords: sandbox mode, test, validation, v3 mail send title: Sandbox Mode group: api-v3 weight: 0 layout: page navigation: show: true --- <call-out> Sandbox mode is only used to validate your request. The email will never be delivered while this feature is enabled! Any requests made in sandbox mode will not generate events in either Event Webhook or Email Activity. No Credits will be consumed. </call-out> Sandbox mode is an optional parameter within `mail_settings`. Enabling sandbox mode allows you to send a test email to ensure that your request body is formatted correctly without delivering the email to any of your recipients. When making a request with sandbox mode enabled, we will validate the form, type, and shape of your request. In other words, sandbox mode will validate each parameter you include and the structure of your JSON payload. If you include a `template_id` in your sandbox mode request, it will be assumed that you have included a subject line and body within the template. We will not validate this content. ## Using Sandbox Mode <call-out type="warning"> When using sandbox mode, you must include the "enable" parameter, and it must be given a boolean value of either true or false. **Do not enclose the boolean value in quotes** or you will receive the error: `The sandbox mode enable param should be a boolean value.` </call-out> ### Valid Request Body When your request validates, you will receive a 200 OK response (as opposed to the 202 ACCEPTED response that is returned for successful non-sandbox requests). ### Invalid Request Body If you submit a request with sandbox mode enabled, but your request body is invalid, you will receive one or more error messages with error codes, detailed explanations for the error or errors, and links to any relevant documentation. ### Example Sandbox Mode JSON The following is an invalid request body intended to demonstrate the validation behavior of sandbox mode for a bad request. #### Request ```json { "personalizations": [{ "to": [{ "email": "john@example.com" }], "subject": "Hello, World!" }], "from": { "email": "John Doe" }, "content": { "type": "text", "value": "Hello, World!" }, "mail_settings": { "sandbox_mode": { "enable": true } } } ``` **Response** ```json { "errors": [ { "field": "from", "message": "The from object must at least have an 'email' parameter with a valid email address and may also contain a 'name' parameter. e.g. {"email": "example@example.com"} or {"email": "example@example.com", "name": "Example Recipient"}" } ] } ``` ================================================ FILE: content/docs/for-developers/sending-email/scheduling-email.md ================================================ --- seo: title: Scheduling Email description: How can I schedule emails to send at specific times? keywords: drip, newsletter, email, future, automate, automated, delay, schedule, delivery title: Scheduling Email group: api-v3 weight: 0 layout: page navigation: show: true --- There are 3 easy ways to schedule your emails; use the [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/), use the [SMTP API]({{root_url}}/for-developers/sending-email/scheduling-parameters/) header, or use the API. <call-out> If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. </call-out> ## 1. Marketing Campaigns If you are using Marketing Campaigns, you can schedule a time to send your campaign from the Settings tab by turning Off the option to Send Immediately. Next, verify that you are using the correct time zone, and then simply choose the date and time that you would like to send your campaign at. You can also schedule your campaigns with the [Marketing Campaigns API](https://sendgrid.api-docs.io/v3.0/single-sends/schedule-single-send). ## 2. API You can schedule a time to send your email by using the `send_at` object of the `POST /mail/send` method of the [V3 API]({{root_url}}/api-reference). For more information about scheduling and stopping scheduled sends with the API, see [Can I Stop an in-progress send]({{root_url}}/for-developers/sending-email/stopping-an-in-progress-send/). ## 3. SMTP API You can use the [SMTP API]({{root_url}}/for-developers/sending-email/scheduling-parameters/) header to schedule your emails when sending via [SMTP]({{root_url}}/for-developers/sending-email/getting-started-smtp/) or our [mail.send API endpoint](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). SendGrid will allow you to queue batches of emails targeting individual recipients by using a UNIX time stamp parameter in your SMTP API header. This parameter allows SendGrid to begin processing your email requests before sending. SendGrid will then queue those messages and release them when the specified time rolls around. Here's an example of how this timestamp might look in your SMTP API JSON header: `{ "send_at": 1409348513 }` ================================================ FILE: content/docs/for-developers/sending-email/scheduling-parameters.md ================================================ --- seo: title: Scheduling Parameters description: Scheduling an email with SMTP keywords: SMTP, send email, scheduling title: Scheduling Parameters group: x-smtpapi weight: 10 layout: page navigation: show: true --- With scheduling, you can send large volumes of email in queued batches or target individual recipients by specifying a custom UNIX timestamp parameter. Using the parameters defined below, you can queue batches of emails targeting individual recipients. <call-out> **Emails can be scheduled up to 72 hours in advance.** However, this scheduling constraint does not apply to campaigns sent via [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/). </call-out> This parameter allows SendGrid to begin processing a customer’s email requests before sending. SendGrid queues the messages and releases them when the timestamp indicates. This technique allows for a more efficient way to distribute large email requests and can **improve overall mail delivery time** performance. This functionality: - Improves efficiency of processing and distributing large volumes of email. - Reduces email pre-processing time. - Enables you to time email arrival to increase open rates. - Is available for free to all SendGrid customers. <call-out> Cancel Scheduled sends by including a batch ID with your send. For more information, check out [Cancel Scheduled Sends](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends)! </call-out> When passing `send_at` or `send_each_at` please make sure to only use UNIX timestamps passed as integers, as shown in our examples. Any other type could result in unintended behavior. </call-out> <call-out type="warning"> Using both `send_at` and `send_each_at` is not valid. Setting both causes your request to be dropped. </call-out> ## Send At To schedule a send request for a large batch of emails, use the `send_at` parameter which will send all emails at approximately the same time. `send_at` is a [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time). ### Example of send_at email header ```json { "send_at": 1409348513 } ``` ## Send Each At To schedule a send request for individual recipients; use `send_each_at` to send emails to each recipient at the specified time. `send_each_at` is a sequence of UNIX timestamps, provided as an array. There must be one timestamp per email you wish to send. ### Example of send_each_at email header ```json { "to": [ "ben@example.com", "john@example.com", "mikeexampexample@example.com", "example@example.com", "example@example.com", "example@example.com" ], "send_each_at": [1409348513, 1409348514, 1409348515] } ``` To allow for the cancellation of a scheduled send, you must include a `batch_id` with your send. To generate a valid `batch_id`, use the [batch id generation endpoint](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends). A `batch_id` is valid for 10 days (864,000 seconds) after generation. ### Example of including a batch_id ```json { "to": [ "ben@example.com", "john@example.com", "mikeexampexample@example.com", "example@example.com", "example@example.com", "example@example.com" ], "send_at": 1409348513, "batch_id": "MWQxZmIyODYtNjE1Ni0xMWU1LWI3ZTUtMDgwMDI3OGJkMmY2LWEzMmViMjYxMw" } ``` ## Additional Resources - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) ================================================ FILE: content/docs/for-developers/sending-email/section-tags.md ================================================ --- seo: title: Section Tags description: Section tags allow you to substitute in content in an SMTP message. keywords: SMTP, send email, section tags title: Section Tags group: x-smtpapi weight: 10 layout: page navigation: show: true --- <call-out type="warning"> Due to low usage, this setting has been deprecated and has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> Section tags allow you to substitute in content in an SMTP message. Section tags are similar to [substitution tags]({{root_url}}/for-developers/sending-email/substitution-tags/) but are specific to the message, and not the recipient. You have to have a substitution tag value for **each** recipient, but you can have any number of section tags. Section tags can then contain Substitution tags for the recipient if needed. Section tags have to be contained within a Substitution tag since SendGrid needs to know which data to populate for the recipient. See the [Section Tag Example Walkthrough](#section-tag-example-walkthrough) below. It's possible and acceptable to use only Substitution tags. However, that method is not [DRY](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself), and you may come against [message size limitations]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/). <call-out type="warning"> When passing `section` please make sure to only use strings as shown in our examples. Any other type could result in unintended behavior. </call-out> The format of the SMTP API section tag has the form: ```json { "section": { ":sectionName1": "section 1 text", ":sectionName2": "section 2 text" } } ``` <call-out> How you flag your section tags may depend on the library you use to create your SMTP connection, the language you are writing your code in, or any intermediate mail servers that your servers will send mail through. In some cases `-subVal-` may be the best choice while in other cases, `%subVal%`, `#subVal#`, or `:subVal` may make more sense. The flag doesn't matter, as long as it's a unique string. </call-out> <call-out type="warning"> Do not use spaces inside your section or substitution tags! For example: `%first name%`. The space breaks the string. </call-out> <call-out type="warning"> Do not nest section tags in sections! This causes your section to not be replaced. </call-out> ## Section Tag Walkthrough Message body sent to SendGrid: ```html <html> <body> Hi :salutation,<br /> Thanks so much for joining us at our event! <p> You have registered for the following event:<br /> :event_details. </p> Thanks,<br /> The SendGrid Team </body> </html> ``` The accompanying X-SMTPAPI JSON header would look like: ```json { "to": [ "example1@example.com", "example2@example.com", "example3@example.com" ], "sub": { ":salutation": [":female", ":male", ":neutral"], ":name": ["Alice", "Bob", "Casey"], ":event_details": [":event1", ":event2", ":event1"], ":event_date": ["Jan 1", "Feb 14", "Aug 11"] }, "section": { ":male": "Mr. :name", ":female": "Ms. :name", ":neutral": ":name", ":event1": "New User Event on :event_date", ":event2": "Veteran User Appreciation on :event_date" } } ``` Alice receives: ```html <html> <body> Hi Ms. Alice,<br /> Thanks so much for joining us at our event! <p> You have registered for the following event:<br /> New User Event on Jan 1. </p> Thanks,<br /> The SendGrid Team </body> </html> ``` Bob receives: ```html <html> <body> Hi Mr. Bob,<br /> Thanks so much for joining us at our event! <p> You have registered for the following event:<br /> Veteran User Appreciation on Feb 14. </p> Thanks,<br /> The SendGrid Team </body> </html> ``` Casey receives: ```html <html> <body> Hi Casey,<br /> Thanks so much for joining us at our event! <p> You have registered for the following event:<br /> New User Event on Aug 11. </p> Thanks,<br /> The SendGrid Team </body> </html> ``` ## Additional Resources - [Substitution Tags]({{root_url}}/for-developers/sending-email/substitution-tags/) - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) ================================================ FILE: content/docs/for-developers/sending-email/segmentation-query-language.md ================================================ --- layout: page weight: 0 title: Segmentation Query Language Reference group: sending-email navigation: show: true seo: title: Segmentation Query Language Reference description: SendGrid Segmentation Query Language Reference keywords: SendGrid, segmentation, segmenting contacts, SGQL --- ## Data Types ### Numeric Any numeric type that can be an integer or float. **Integer**: [1-9][0-9]* **Float**: [0-9]+.[0-9]+ ### String A set of characters delimited by double or single quotes. #### Escaping Escaping must be done for the character used as the delimiter if it is found within the string. The escape character is the backslash, `\`, which must also be escaped with a preceding `\`. ##### Escaping example ```text 'Hello, World! It\'s a beautiful day' ``` #### Wildcards When using the `LIKE` or `NOT LIKE` operators, The percentage symbol, `%`, will be interpreted as a wildcard character. To escape this character and not treat it as a wildcard, a second `%` should be used. ##### Wildcard example ```text "email LIKE '%gmail.com'" ``` ### DateTime A timestamp whose literal value is formatted as a string in ISO 8601 format: `YYYY-MM-DDTHH:mm:SSZ(-)HH:mm` ### Interval A time interval with an integral scalar value and some unit of time, which can be one of the following: second, minute, hour, day, month, or year. ##### Interval example ```text "10 day" ``` ### Boolean Boolean values are true or false. ### Null Null is a special type that represents a lack of a value. ## Operators ### Logical <table> <tr> <th>Operator</th> <th>Associativity</th> <th>Operands</th> </tr> <tr> <td>AND</td> <td>Left</td> <td>2</td> </tr> <tr> <td>OR</td> <td>Left </td> <td>2</td> </tr> <tr> <td>NOT</td> <td>Right</td> <td>2 (binary)</td> </tr> <tr> <td>NOT</td> <td>Right</td> <td>1 (unary)</td> </tr> </table> ### Arithmetic Precedence from low to high: <table> <tr> <th>Operator</th> <th>Associativity</th> <th>Operands</th> <th>Supported Types</th> </tr> <tr> <td>-</td> <td>Left</td> <td>2 (binary)</td> <td>Numeric - Numeric<br>DateTime - Interval</td> </tr> <tr> <td>+ </td> <td>Left</td> <td>2</td> <td>Numeric + Numeric<br>DateTime + Interval<br>String + String (concatenation)</td> </tr> <tr> <td>/</td> <td>Left</td> <td>2 </td> <td>Numeric / Numeric</td> </tr> <tr> <td>*</td> <td>Left</td> <td>2</td> <td>Numeric * Numeric</td> </tr> <tr> <td>%</td> <td>Left</td> <td>2</td> <td>Numeric % Numeric (modulo)</td> </tr> <tr> <td>- </td> <td>Left</td> <td>1 (unary)</td> <td>- Numeric</td> </tr> </table> ### Comparison <table> <tr> <th>Operator</th> <th>Supported Types (T represents any type)</th> </tr> <tr> <td>=</td> <td>T = T</td> </tr> <tr> <td>!=</td> <td>T != T</td> </tr> <tr> <td><</td> <td>Numeric < Numeric<br>DateTime < DateTime<br>String < String</td> </tr> <tr> <td>></td> <td>Numeric < Numeric<br>DateTime < DateTime<br>String < String</td> </tr> <tr> <td><=</td> <td>Numeric < Numeric<br>DateTime < DateTime<br>String < String</td> </tr> <tr> <td>>=</td> <td>Numeric < Numeric<br>DateTime < DateTime<br>String < String</td> </tr> <tr> <td>LIKE/ NOT LIKE</td> <td>String (NOT) LIKE String</td> </tr> <tr> <td>IS (NOT)</td> <td>T is (NOT) NULL</td> </tr> <tr> <td>(NOT) IN</td> <td>T IN (T)</td> </tr> <tr> <td>(NOT) BETWEEN</td> <td>Numeric (NOT) BETWEEN Numeric AND Numeric<br>DateTime (NOT) BETWEEN DateTime AND DateTime<br>String (NOT) BETWEEN String AND String</td> </tr> </table> ## Identifiers Identifiers are named things within a given query. These include both function names and field/column names. Identifiers cannot be a keyword and must only allow the characters: `[a-zA-Z_]+.`. <call-out> Identifiers that do not meet the previous format may still be used. However, they must be encapsulated within backticks. I.E. \`000supercoolid\` </call-out> ## Functions Functions can be invoked with or without parameters by providing the function name—remember, function names are identifiers—followed by a list of comma separated arguments enclosed in parentheses. ##### Function called with arguments example ```text MY_FUNCTION(a,b,c) ``` ### Well Defined Functions These are functions that should be used consistently across consumers of the parser. Whether or not your implementation actually supports them is up to you. #### CONTAINS() ```text CONTAINS(array_or_map, value_or_key) ``` Contains should return a boolean indicating the presence of a value in an array or map. When used with an array, true should be returned when the array holds the given value. When used with a map, true should be returned when the map has an element with the given key. #### CONCAT() ```text CONCAT(string_one,string_two) ``` Concat takes two strings, combines them as a single string in the order they are passed in, and returns the result. #### LENGTH() ```text LENGTH(string) ``` Length takes a single string and returns the number of characters in the string. #### LOWER() ```text LOWER(string) ``` Lower returns a lowercase version of the given string. #### NOW() ```text NOW() ``` Returns the current date and time. ## Fields A number of fields are available on every contact. These include the strings: - `alternate_emails` - `address_line_1` - `address_line_2` - `city` - `contact_id` - `country` - `created_at` - `email` - `email_domains` - `event_data` - `event_source` - `event_timestamp` - `event_type` - `first_name` - `list_ids` - `last_name` - `postal_code` - `state_province_region` - `updated_at` <call-out> In the future, the address fields may be used with a third-party service to populate a `location` type field when contacts are added or updated. In addition, a contact's `alternate_emails` field represents a set of strings. </call-out> ## Examples and Use Cases ### A query for getting all gmail users: ```json { "name": "All Gmail Users", "query_dsl": "email LIKE '%gmail.com'" } ``` ### A query for getting contacts in specific zip codes: ```json { "name": "My Favorite Zip Codes", "query_dsl": "postal_code IN ('90124', '90125', '90126')" } ``` ### A query for getting contacts NOT in specific zip codes: ```json { "name": "My Least Favorite Zip Codes", "query_dsl": "postal_code NOT IN ('90124', '90125', '90126')" } ``` ### A query showing how to use lowercase text: ```json { "name": "Everyone named Bob, BOB or bob", "query_dsl": "lower(first_name) = 'bob'" } ``` ### A query for contacts that received any email in the last 10 days: ```json { "name": "All Delivered in Last 10 days", "query_dsl": "(event_source = 'mail' AND event_type = 'delivered' AND event_timestamp >= (NOW() - interval 10 day))" } ``` ### A query for contacts that received any email between two dates: ```json { "name": "All Delivered in Last 10 days", "query_dsl": "(event_source = 'mail' AND event_type = 'delivered' AND event_timestamp BETWEEN TIMESTAMP '2019-08-07T18:00:00Z' AND TIMESTAMP '2019-08-08T18:00:00Z')" } ``` ================================================ FILE: content/docs/for-developers/sending-email/send-mime-messages-with-sendgrid.md ================================================ --- layout: page weight: 10 title: Send Mime Messages With SendGrid group: api-v3 navigation: show: true --- ## Sending MIME Mail Some mail clients, such as Outlook and Thunderbird, appear to insert double spacing line breaks at every line. The reason is that those mail clients set the 'content-transfer-encoding' in MIME to 'quoted-printable' which adds Carriage Return Line Feed (CRLF) line breaks to the source content of the email which are characters interpreted by these mail clients. To alleviate this problem, please do the following: 1. If you can customize the MIME settings for your email, set the 'Content-Transfer-Encoding' to '7bit' instead of 'Quoted-Printable.' 1. Ensure that your content follows the line length limits. 1. Line breaks appear as CRLF characters in the source of an email with the character combination of " =0D" in the source of an email. These characters appear only with 'quoted-printable' (Content-Transfer-Encoding set in MIME) emails. Email clients such as Outlook and Thunderbird render these characters which resulting in additional breaks in the content of your emails. Use the MIME layout in your email below when sending through SendGrid. It is best to reference files using separate links to download since it lowers the percentage of spam threshold for most domains you are sending to. ## Sending email with multiple content types (text+html) ``` language email = SendGrid::Mail.new email.from = SendGrid::Email.new(email: 'team@email.com') email.subject = "App - Reset Password" per = SendGrid::Personalization.new per.to = SendGrid::Email.new(email: user.email, name: user.name) per.substitutions = SendGrid::Substitution.new(key: "user_name", value: user.name.split(" ")[0].capitalize) per.substitutions = SendGrid::Substitution.new(key: "reset_link", value: some_func(token, email: user.email)) email.personalizations = per email.contents = Content.new(type: 'text/html', value: 'test') email.contents = SendGrid::Content.new(type: 'text/plain', value: "Hi #{user.name}.. Click the following link to reset your password.. #{function_reset(token, email: user.email)}... This link will expire in two hours.. If you did not request your password to be reset, please ignore this email and your password will stay as it is.") email.template_id = "6ede18bb-2eba-4958-8a57-43a58a559a0a" response = @@sg.client.mail._('send').post(request_body: email.to_json) puts response.status_code puts response.body puts response.headers ``` ================================================ FILE: content/docs/for-developers/sending-email/sender-identity.md ================================================ --- layout: page title: Sender Identity group: sending-email navigation: show: false seo: title: Sender Identity override: true description: Understanding the difference between Domain Authentication and verifying a Single Sender. --- To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Sender Identities. A Sender Identity represents your “From” email address—the address your recipients will see as the sender of your emails. You can verify one or more Sender Identities using either Domain Authentication or Single Sender Verification. There are advantages to both verification methods, and we provide detailed guides to configure whichever option you choose. This page offers a high-level overview of Single Sender Verification and Domain Authentication to help you decide which option best fits your needs. ### Single Sender Verification Single Sender Verification is a fast way to verify your Sender Identity when you don’t have access to the DNS settings for your domain. Though you will want to complete Domain Authentication for your production mail send, Single Sender Verification is a great way to start quickly while building a proof of concept or test. #### Advantages of Single Sender Verification - Single Sender Verification is a quick method of verification when starting. - You can send from a single email address that you confirm ownership of by clicking a verification link in the email’s inbox. #### Disadvantages of Single Sender Verification - Single Sender Verification is recommended for testing only. - You can send only from the address you verify rather than any address on an authenticated domain. To verify a Single Sender, see our [Single Sender Verification page]({{root_url}}/ui/sending-email/sender-verification). ### Domain Authentication <call-out> Please note, you must have the ability to edit the DNS records on the domain you want to authenticate. </call-out> Domain Authentication is the preferred method of verification. Though Single Sender Verification provides a quick start, Domain Authentication should be completed before you launch your mail send into production. If access to DNS records is a barrier for you, you can always start with Single Sender Verification and return to Domain Authentication once you obtain DNS access. #### Advantages of Domain Authentication - An authenticated domain improves mail deliverability and a sender's reputation. - Domain Authentication is an industry best practice that's ideal for production sending. - You can send from any email address on your authenticated domain. To authenticate your domain, see [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). ================================================ FILE: content/docs/for-developers/sending-email/sendmail.md ================================================ --- layout: page weight: 0 title: Sendmail group: mail-servers navigation: show: true --- <call-out type="warning"> Sendmail requires libsasl in order to properly send authentication requests to SendGrid servers. The saslauthd server daemon is not required unless you plan to receive authentication requests to the same server. [For more information on configuring sendmail for SASL support, check the official documentation](http://www.sendmail.com/sm/open_source/tips/compiling_sendmail/#SASL). </call-out> Set the authorization credentials in **/etc/mail/access** <call-out type="warning"> We have had reports that some customers have needed to install `cyrus-sasl-plain` in order to avoid authentication issues as well. We have not validated this requirement, so please make sure your system administrators, Ops, and/or InfoSec people approve this change before you make it! </call-out> ```bash AuthInfo:smtp.sendgrid.net "U:apikey" "P:yourAPIKey" "M:PLAIN" ``` Define the Smart Host in **/etc/mail/sendmail.mc** You should add these lines just after the commented "\#dnl define('SMART_HOST', 'smtp.your.provider')dnl" line in the file ```bash define(`SMART_HOST', `smtp.sendgrid.net')dnl FEATURE(`access_db')dnl define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl ``` Update sendmail.cf and access.db files (You will need to run these commands as 'su' or 'root') ```bash $ cd /etc/mail $ m4 sendmail.mc >sendmail.cf $ makemap hash access.db < access ``` On older distros, you can run restart sendmail like so: ```bash $ /etc/init.d/sendmail restart ``` If, however, you're using a newer version, do the following to restart: ```bash $ service sendmail restart ``` ================================================ FILE: content/docs/for-developers/sending-email/single-sends-2020-update.md ================================================ --- layout: page weight: 0 title: Single Sends 2020 Update group: sending-email navigation: show: false seo: title: Single Sends 2020 Update description: Instructions for migrating to the updated Single Sends API keywords: --- <call-out type="warning"> **Action required to ensure successful create, read, and update operations using the Single Sends API**. The Single Sends API has changed. Please check this page for instructions. </call-out> To improve your experience when working with the Single Sends API, Twilio SendGrid has streamlined the API’s request and response formats. You can now pass all the required information to create a Single Send in one request, eliminating the need to first create a template. These improvements require modifications to your code. To ease this transition, we initially released the updated API while continuing to provide the previous API at a new root path until June 6, 2020. The previous API should not be relied on after June 6, 2020 and will be removed. The information below outlines the changes between the two APIs to help you migrate your code if have not done so already. ## Migrating to the new API **New API available at**: `https://api.sendgrid.com/v3/marketing/singlesends` All requests to the `/marketing/singlesends` root path must use the updated request format. Any requests to `/marketing/singlesends` using the previous Single Sends format will result in a 400-level error. ## API request and response bodies The new Single Sends API request and response bodies have been refined to contain only five top level fields: `name`, `categories`, `send_at`, `send_to`, and `email_config`. Both `send_to` and `email_config` are object types containing additional fields. The `email_config` field provides the ability to send data that would currently be associated with a template. Rather than first creating a template and then passing a template ID to the Single Sends create endpoint, all template data can be passed in the initial request using the fields in the `email_config` object. The table below provides a list of all available fields for both the existing API and updated API. Notes are made where fields have been reorganized in the schema. Please see our [API reference](https://sendgrid.api-docs.io/v3.0/single-sends) for full documentation and code samples. ### Single Sends API fields <table> <tbody> <tr> <td colspan="1" rowspan="1"> <p><span style="font-weight: bold">Field: Existing Single Sends API</span></p> </td> <td colspan="1" rowspan="1"> <p><span style="font-weight: bold">Field: Updated Single Sends API</span></p> </td> <td colspan="1" rowspan="1"> <p><span style="font-weight: bold">Notes</span></p> </td> <td colspan="1" rowspan="1"> <p><span style="font-weight: bold">Response or Request Field</span></p> </td> <td colspan="1" rowspan="1"> <p><span style="font-weight: bold">Data Type</span></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>name</code></p> </td> <td colspan="1" rowspan="1"> <p><code>name</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p>Both</p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>categories</code></p> </td> <td colspan="1" rowspan="1"> <p><code>categories</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>array[string]</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>sender_id</code></p> </td> <td colspan="1" rowspan="1"> <p><code>sender_id</code></p> </td> <td colspan="1" rowspan="1"> <p> <span>Moved to <code>email_config</code>: <code>sender_id</code></span> </p> </td> <td colspan="1" rowspan="1"> <p>Both</p> </td> <td colspan="1" rowspan="1"> <p><code>integer</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>status</code></p> </td> <td colspan="1" rowspan="1"> <p><code>status</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Response</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>custom_unsubscribe_url</code></p> </td> <td colspan="1" rowspan="1"> <p> <code>email_config</code>: <code>custom_unsubscribe_url</code> </p> </td> <td colspan="1" rowspan="1"> <p> <span >Moved to <code>email_config</code>: <code>custom_unsubscribe_url</code></span > </p> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>id</code></p> </td> <td colspan="1" rowspan="1"> <p><code>id</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Response</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>suppression_group_id</code></p> </td> <td colspan="1" rowspan="1"> <p><code>id</code></p> </td> <td colspan="1" rowspan="1"> <p> <span >Moved to <code>email_config</code>: <code>suppression_group_id</code></span > </p> </td> <td colspan="1" rowspan="1"> <p ><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>integer</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>filter</code>: <code>list_ids</code></p> </td> <td colspan="1" rowspan="1"> <p><code>send_to</code>: <code>list_ids</code></p> </td> <td colspan="1" rowspan="1"> <p> <span>Moved to <code>send_to</code>: <code>list_ids</code></span> </p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p class="c0"><code>array[string]</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>filter</code>: <code>send_to_all</code></p> </td> <td colspan="1" rowspan="1"> <p><code>send_to</code>: <code>all</code></p> </td> <td colspan="1" rowspan="1"> <p><span>Moved to <code>send_to</code>: <code>all</code></span></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>boolean</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>send_at</code></p> </td> <td colspan="1" rowspan="1"> <p><code>send_at</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>template_id</code></p> </td> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>updated_at</code></p> </td> <td colspan="1" rowspan="1"> <p><code>updated_at</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Response</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>created_at</code></p> </td> <td colspan="1" rowspan="1"> <p><code>created_at</code></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Response</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><code>ip_pool</code></p> </td> <td colspan="1" rowspan="1"> <p><span><code>email_config</code>: <code>ip_pool</code></span></p> </td> <td colspan="1" rowspan="1"> <p> <span>Moved to <code>email_config</code>: <code>ip_pool</code></span> </p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p><span><code>send_to</code>: <code>segment_ids</code></span></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>array[string]</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p><span><code>email_config</code>: <code>subject</code></span></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p> <span><code>email_config</code>: <code>html_content</code></span> </p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p> <span><code>email_config</code>: <code>plain_content</code></span> </p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><span>string</span></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p> <span><code>email_config</code>: <code>generate_plain_content</code></span> </p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>boolean</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p> <span><code>email_config</code>: <code>design_id</code></span> </p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Request</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> <tr> <td colspan="1" rowspan="1"> <p><span>NA</span></p> </td> <td colspan="1" rowspan="1"> <p><span><code>email_config</code>: <code>editor</code></span></p> </td> <td colspan="1" rowspan="1"> <p></p> </td> <td colspan="1" rowspan="1"> <p><span>Both</span></p> </td> <td colspan="1" rowspan="1"> <p><code>string</code></p> </td> </tr> </tbody> </table> ================================================ FILE: content/docs/for-developers/sending-email/smtp-errors-and-troubleshooting.md ================================================ --- seo: title: SMTP Errors and Troubleshooting description: SMTP Response codes and troubleshooting tips keywords: SMTP, send email, integrate, building, filters, scheduling, substitution, suppression groups, unique arguments, recipients title: SMTP Errors and Troubleshooting group: smtp weight: 0 layout: page navigation: show: true --- ## Response codes Each SMTP call you make returns a response. `200` responses are usually success responses, and `400` responses are usually deferrals. SendGrid continues to retry resending `400` messages for up to 72 hours. `500` responses are hard failures that are not retried by our servers. This table has possible response codes with example errors and a general explanation of that sort of response. <table class="table"> <colgroup> <col class="table-col-100"> <col> <col> </colgroup> <tr> <th>Error</th> <th>Message</th> <th>Explanation</th> </tr> <tr> <td>250</td> <td>`Queued mail for delivery`</td> <td>Your mail has been successfully queued! This response indicates that the recipient server has accepted the message.</td> </tr> <tr> <td>403</td> <td>`You are not authorized to send from that email address`</td> <td>This means the "from" address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. To learn how to resolve this error, see our [Sender Identity requirements]({{root_url}}for-developers/sending-email/sender-identity/).</td> </tr> <tr> <td>421</td> <td>`Message from (X.X.X.X) temporarily deferred`</td> <td>Messages are temporarily deferred because of recipient server policy - often it's because of too many messages or connections in too short of a timeframe. We continue to retry deferred messages for up to 72 hours. Consider temporarily sending less messages to a domain that is returning this code because this could further delay your messages currently being tried.</td> </tr> <tr> <td>450</td> <td>`too frequent connects from 198.37.147.135, please try again later.`</td> <td>The message failed because the recipient's mailbox was unavailable, perhaps because it was locked or was not routable at the time. We continue to retry messages for up to 72 hours. Consider temporarily sending less messages to a domain that is returning this code because this could further delay your messages currently being tried.</td> </tr> <tr> <td>451</td> <td>`Temporary local problem - please try later`</td> <td>The message simply failed, usually due to a far-end server error. We continue to retry messages for up to 72 hours.</td> </tr> <tr> <td>451</td> <td>`Authentication failed: Maximum credits exceeded`</td> <td>There is a credit limit of emails per day enforced in error. <a href="https://support.sendgrid.com/hc/en-us">Contact support</a> to remove that limit.</td> </tr> <tr> <td>452</td> <td>`Too many recipients received this hour (throttled)`</td> <td>The message has been deferred due to insufficient system storage. We continue to retry messages for up to 72 hours.</td> </tr> <tr> <td>550</td> <td>`Requested action not taken: mailbox unavailable`</td> <td>The user’s mailbox was unavailable. Usually because it could not be found, or because of incoming policy reasons. Remove these address from your list - it is likely a fake, or it was mistyped.</td> </tr> <tr> <td>551</td> <td>`User does not exist.`</td> <td>The intended mailbox does not exist on this recipient server. Remove these addresses from your list.</td> </tr> <tr> <td>552</td> <td>`This message is larger than the current system limit or the recipient’s mailbox is full. Create a shorter message body or remove attachments and try sending it again.`</td> <td>The recipients mailbox has exceeded its storage limits. We don't resend messages with this error code because this is usually a sign this is an abandoned email.</td> </tr> <tr> <td>553</td> <td>`Invalid/inactive user.`</td> <td>The message was refused because the mailbox name is either malformed or does not exist. Remove these addresses from your list.</td> </tr> <tr> <td>554</td> <td>`ERROR: Mail refused`</td> <td>This is a default response that can be caused by a lot of issues. There is often a human readable portion of this error that gives more detailed information, but if not, remove these addresses from your list.</td> </tr> <tr> <td>Other</td> <td>`Delayed Bounce - Unable to Parse Server Reason`</td> <td>This is what SendGrid displays when the reciepients server returns a blank reason code.</td> </tr> </table> ## Turning off click tracking To turn off click tracking, add this to your X-SMTPAPI header: ```json { "filters": { "clicktrack": { "settings": { "enable": 0 } } } } ``` ## Invalid SMTP API header When you try to send an invalid X-SMTPAPI header, you will get an email with details about the invalidations. You may also see errors on your Email Activity page or in your Event Webhook data. If this happens, the email should give you the information you need to begin troubleshooting. We also recommend uploading your JSON into a JSON validator, because this is often an invalid JSON issue. ## Certificate verification failed for smtp.sendgrid.net `"certificate verification failed for [smtp.sendgrid.net](http://smtp.sendgrid.net/)[198.37.144.225]:587: untrusted issuer /C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority"` If you receive this error, the connection is still encrypted; it's just that your server doesn't have the necessary CA (certificate authority) certificates to confirm that our certificate is valid. _To update your certificates:_ 1. Download the GoDaddy CA bundle from [https://certs.godaddy.com/anonymous/repository.pki](https://certs.godaddy.com/anonymous/repository.pki) (grab the one called `"gd_bundle-g2-g1.crt"`). 1. Save that on your server. 1. Tell Postfix where to find it by adding or editing the following line in `/etc/postfix/` [main.cf](http://main.cf/): `"smtp_tls_CAfile = /etc/postfix/ssl/gd_bundle-g2-g1.crt"` 1. Restart Postfix to make the change take effect. If the mail server communicates with more than just us, add this certificate to your existing CA bundle (frequently called `ca-bundle.crt`). ## 550 Unauthenticated Senders Not Allowed If you’re getting an “Unauthenticated Senders Not Allowed” error, the problem usually lies in authenticating with our SMTP server. This error gets triggered when there was an attempt to hand over an email message through smtp.sendgrid.net before authenticating the connection with your SendGrid username and API key. To fix this issue, you’ll want to make sure that you’ve configured your setup to connect to `smtp.sendgrid.net` using authentication, and that the credentials you’re using are your SendGrid username and a properly configured API key as the password. For more on API keys, see [API Keys]({{root_url}}/ui/account-and-settings/api-keys/). If you’re using cPanel/Exim, you’ll want to make sure it’s configured to authenticate every time it connects to `smtp.sendgrid.net`. ## Additional Resources - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) ================================================ FILE: content/docs/for-developers/sending-email/smtp-filters.md ================================================ --- layout: page weight: 0 title: SMTP Filters group: x-smtpapi navigation: show: true --- Following are the settings that can be specified in the filters section of the X-SMTPAPI header. All filters and setting names must be lowercase. <call-out> - If you're enabling a Setting, also called a filter, via SMTPAPI, you are required to define all of the parameters for that Setting. - If you enable a disabled setting, our system will not pull your settings for the disabled setting. You will need to define the settings in your X-SMTPAPI header <em>Example:</em> If you have a footer designed but disabled, you can't just enable it via the API; you need to define the footer in the API call itself. - All filter names and setting names must be lowercase. </call-out> For more information on the utility of these settings, please check out the [Settings]({{root_url}}/ui/account-and-settings/account/) section. <call-out> Some Settings are not listed here because they cannot be defined on a per-message basis. To update these other Settings, please refer to the [Web API Filter Settings](https://sendgrid.api-docs.io/v3.0/settings-mail) commands. </call-out> ## Filter: bcc <call-out type="warning"> Due to low usage, this setting has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> <p>Sends a BCC copy of the email created in this transaction to the address specified.</p> <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>email</td> <td><code>email</code></td> <td>email address destination for the bcc message</td> </tr> </tbody> </table> ```json { "filters": { "bcc": { "settings": { "enable": 1, "email": "example@example.com" } } } } ``` ## Filter: bypass_list_management <call-out type="warning"> This setting is very powerful, and can only be used on a per-message basis. Use with extreme caution. To learn more about the more granular bypass settings available in the v3 Mail Send API, see our [Suppressions Overview documentation]({{root_url}}/ui/sending-email/index-suppressions/#bypass-suppressions). </call-out> Some emails are too important to do normal list management checks, such as password resets or critical alerts. Enabling this filter will bypass the normal unsubscribe / bounce / spam report checks and queue the email for delivery. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> </tbody> </table> ```json { "filters": { "bypass_list_management": { "settings": { "enable": 1 } } } } ``` ## Filter: clicktrack Rewrites links in email text and html bodies to go through our webservers, allowing for tracking when a link is clicked on. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>enable_text</td> <td><code>true</code> | <code>false</code></td> <td>Enable or Disable click-tracking links in the Plain-Text portion of the message.</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "clicktrack": { "settings": { "enable": 1, "enable_text": true } } } } ``` ## Filter: dkim Allows you to specify the domain to use to sign messages with DKIM certification. This domain should match the domain in the From address of your email. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>domain</td> <td><code>domain</code></td> <td>The domain you would like your DKIM certification signed with</td> </tr> <tr> <td>use_from</td> <td><code>0</code> | <code>1</code></td> <td>If enabled, the domain in the From: header of the email will be used to sign your DKIM</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "dkim": { "settings": { "domain": "example.com", "use_from": false } } } } ``` ## Filter: footer Inserts a footer at the bottom of the text and HTML bodies. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>text/html</td> <td><code>string</code></td> <td>String containing html body</td> </tr> <tr> <td>text/plain</td> <td><code>string</code></td> <td>String containing text body</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "footer": { "settings": { "enable": 1, "text/html": "<p>Thanks,<br />The SendGrid Team<p>", "text/plain": "Thanks,\n The SendGrid Team" } } } } ``` ## Filter: ganalytics Re-writes links to integrate with Google Analytics. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>utm_source</td> <td><code>string</code></td> <td>Value for the utm_source field</td> </tr> <tr> <td>utm_medium</td> <td><code>string</code></td> <td>Value for the utm_medium field</td> </tr> <tr> <td>utm_term</td> <td><code>string</code></td> <td>Value for the utm_term field</td> </tr> <tr> <td>utm_content</td> <td><code>string</code></td> <td>Value for the utm_content field</td> </tr> <tr> <td>utm_campaign</td> <td><code>string</code></td> <td>Value for the utm_campaign field</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "ganalytics": { "settings": { "enable": 1, "utm_source": "Transactional Email", "utm_medium": "email", "utm_content": "Reset Your Password", "utm_campaign": "Redesigned Transactional Messaging" } } } } ``` ## Filter: opentrack If you don't use 'replace' this will insert an <code><img></code> tag at the bottom of the html section of an email which will be used to track if an email is opened. If you choose to use 'replace', you can put the tracking pixel wherever you would like in the email and SendGrid will replace it at send time. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>replace</td> <td>string</td> <td>A string to be replaced by SendGrid with the tracking image at send time.</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "opentrack": { "settings": { "enable": 1, "replace": "%opentrack%" } } } } ``` ## Filter: spamcheck <call-out type="warning"> Due to low usage, this setting has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> Tests message with [SpamAssassin](http://spamassassin.apache.org/) to determine if it is spam, and drop it if it is. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>maxscore</td> <td><code>1</code> to <code>10.0</code></td> <td>Score after which the message will be dropped (default is 5.0, higher scores indicate higher likelihood of spam)</td> </tr> <tr> <td>url</td> <td><code>url</code></td> <td>an optional url to POST the email and a copy of the report to. Refer to the <a href="https://sendgrid.com/docs/ui/account-and-settings/mail/#spam-checker">Spam Checker documentation</a> for POST details.</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "spamcheck": { "settings": { "enable": 1, "maxscore": 3.5, "url": "http://example.com/compliance" } } } } ``` ## Filter: subscriptiontrack Inserts a subscription management link at the bottom of the text and html bodies or insert the link anywhere in the email. If you wish to append an unsubscription link, use the <code>text/html</code> and <code>text/plain</code> parameters. However, if you wish to have the link replace a tag (such as <code>[unsubscribe]</code>), use the <code>replace</code> parameter. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this App</td> </tr> <tr> <td>text/html</td> <td><code>string</code></td> <td>HTML to be appended to the email, with the subscription tracking link. You may control where the link is by using a tag like so: <code><% link text %></code></td> </tr> <tr> <td>text/plain</td> <td><code>string</code></td> <td>Text to be appended to the email, with the subscription tracking link. You may control where the link is by using a tag like so: <code><% %></code></td> </tr> <tr> <td>replace</td> <td><code>string</code></td> <td>A tag that will be replaced with the unsubscribe URL (e.g. <code>[unsubscribe_url]</code>). If this parameter is included, it will override <code>text/html</code> and <code>text/plain</code> The URL of the link will be placed at the replace tag's location, with no html or other formatting.</td> </tr> </tbody> </table> <call-out type="warning"> The `landing` argument cannot be used in SMTPAPI. It can only be setup via the UI or WebAPI, as an account-level setting. </call-out> #### Example X-SMTPAPI Header Value ```json { "filters": { "subscriptiontrack": { "settings": { "text/html": "If you would like to unsubscribe and stop receiving these emails <% click here %>.", "text/plain": "If you would like to unsubscribe and stop receiving these emails click here: <% %>.", "enable": 1 } } } } ``` ## Filter: templates <call-out> This setting refers to SendGrid's [transactional templates](https://sendgrid.api-docs.io/v3.0/transactional-templates). SendGrid supports versioning, and the ability to create multiple transactional templates. Previously, we had a Template App, which is now referred to as the [Legacy Template App](#template). </call-out> Uses a [transactional template](https://sendgrid.api-docs.io/v3.0/transactional-templates) when sending an email. <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>template_id</td> <td><code>string</code></td> <td>The ID of the template to use when sending a message, represented by a string.</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "templates": { "settings": { "enable": 1, "template_id": "5997fcf6-2b9f-484d-acd5-7e9a99f0dc1f" } } } } ``` ## Filter: template <call-out type="warning"> This setting refers to our original Email Template app. We now support more fully featured [transactional templates](#templates). You may create multiple transactional templates that allow for versioning, in addition to several other features. </call-out> <p>Wraps a template around your email content. Useful for sending out marketing email and other nicely formatted messages.</p> <table class="table table-striped table-bordered"> <tbody> <tr> <th>Parameter Name</th> <th>Parameter Value</th> <th>Parameter Description</th> </tr> <tr> <td>enable</td> <td><code>0</code> | <code>1</code></td> <td>Disable or enable this Setting</td> </tr> <tr> <td>text/html</td> <td><code>string</code></td> <td>String containing html content for the template (must contain a <code><% body %></code> tag)</td> </tr> </tbody> </table> #### Example X-SMTPAPI Header Value ```json { "filters": { "template": { "settings": { "enable": 1, "text/html": "<html><head></head><body bgcolor='pink'><div style='width:200px' bgcolor='#FFF'><% body %></div></body></html>" } } } } ``` ================================================ FILE: content/docs/for-developers/sending-email/smtp-go-code-example.md ================================================ --- layout: page weight: 0 title: SMTP Go Code Example group: x-smtpapi navigation: show: true --- SendGrid recommends using our [Go SMTPAPI library](https://github.com/sendgrid/smtpapi-go), full documentation can be found on GitHub. Our [Go API library](https://github.com/sendgrid/sendgrid-go) allows you to fully integrate with SendGrid. ================================================ FILE: content/docs/for-developers/sending-email/smtp-nodejs-code-example.md ================================================ --- layout: page weight: 0 title: SMTP Node.js Code Example group: x-smtpapi navigation: show: true --- SendGrid recommends using our [Node.js SMTPAPI library](https://github.com/sendgrid/smtpapi-nodejs), full documentation can be found on GitHub. Our [Node.js API library](https://github.com/sendgrid/sendgrid-nodejs) allows you to fully integrate with SendGrid. ================================================ FILE: content/docs/for-developers/sending-email/smtp-perl-code-example.md ================================================ --- layout: page weight: 0 title: SMTP Perl Code Example group: x-smtpapi navigation: show: true --- <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> ## SmtpApiHeader.pm ```perl #!/usr/bin/perl # Version 1.0 # Last Updated 6/22/2009 use strict; package SmtpApiHeader; use JSON; sub new { my $self = shift; my @a = (); $self = { 'data' => { }}; bless($self); return $self; } sub addTo { my $self = shift; my @to = @_; push(@{$self->{data}->{to}}, @to); } sub addSubVal { my $self = shift; my $var = shift; my @val = @_; if (!defined($self->{data}->{sub}->{$var})) { $self->{data}->{sub}->{$var} = (); } push(@{$self->{data}->{sub}->{$var}}, @val); } sub setUniqueArgs { my $self = shift; my $val = shift; if (ref($val) eq 'HASH') { $self->{data}->{unique_args} = $val; } } sub setCategory { my $self = shift; my $cat = shift; $self->{data}->{category} = $cat; } sub addFilterSetting { my $self = shift; my $filter = shift; my $setting = shift; my $val = shift; if (!defined($self->{data}->{filters}->{$filter})) { $self->{data}->{filters}->{$filter} = {}; } if (!defined($self->{data}->{filters}->{$filter}->{settings})) { $self->{data}->{filters}->{$filter}->{settings} = {}; } $self->{data}->{filters}->{$filter}->{settings}->{$setting} = $val; } sub asJSON { my $self = shift; my $json = JSON->new; $json->space_before(1); $json->space_after(1); return $json->encode($self->{data}); } sub as_string { my $self = shift; my $json = $self->asJSON; $json =~ s/(.{1,72})(\s)/$1\n /g; my $str = "X-SMTPAPI: $json"; return $str; } ``` ## Example Perl Usage ```perl #!/usr/bin/perl use SmtpApiHeader; my @receiver = ('kyle','bob','someguy'); my $hdr = SmtpApiHeader->new; my $time = '1pm'; my $name = 'kyle'; $hdr->addFilterSetting('subscriptiontrack', 'enable', 1); $hdr->addFilterSetting('twitter', 'enable', 1); #please check the apps available for your current package at https://sendgrid.com/pricing $hdr->addTo(@receiver); $hdr->addTo('kyle2'); $hdr->addSubVal('-time-', $time); $hdr->addSubVal('-name-', $time); $hdr->setUniqueArgs({'test'=>1, 'foo'=>2}); print $hdr->as_string; print "\n"; </code> ## Full Perl Example <p>The following code builds a MIME mail message demonstrating all the portions of the SMTP API protocol. To use this example, you will need to have the following perl modules installed:</p> <ul class="regular"> <li>MIME::Entity</li> <li>Authen::SASL</li> <li>JSON</li> </ul> <code> #!/usr/bin/perl use strict; use SmtpApiHeader; use MIME::Entity; use Net::SMTP; my $hdr = SmtpApiHeader->new; # The list of addresses this message will be sent to my @toList = ('isaac@example', 'tim@example', 'jose@example'); # The names of the recipients my @nameList = ('Isaac', 'Tim', 'Jose'); # Another substitution variable my @timeList = ('4pm', '1pm', '2pm'); # Set all of the above variables $hdr->addTo(@toList); $hdr->addSubVal('-name-', @nameList); $hdr->addSubVal('-time-', @timeList); # Specify that this is an initial contact message $hdr->setCategory("initial"); # Enable a text footer and set it $hdr->addFilterSetting('footer', 'enable', 1); $hdr->addFilterSetting('footer', "text/plain", "Thank you for your business"); my $from = 'you@yourdomain.com'; # For multiple recipient emails, the 'to' address is irrelevant my $to = 'example@example.com'; my $plain = <<EOM; Hello -name-, Thank you for your interest in our products. We have set up an appointment to call you at -time- EST to discuss your needs in more detail. Regards, Fred EOM my $html = <<EOM; <html> <head></head> <body> <p>Hello -name-,<br /> Thank you for your interest in our products. We have set up an appointment<br /> to call you at -time- EST to discuss your needs in more detail.<br /> Regards,<br /> Fred<br /> </p> </body> </html> EOM # Create the MIME message that will be sent. Check out MIME::Entity on CPAN for more details my $mime = MIME::Entity->build(Type => 'multipart/alternative' , Encoding => '-SUGGEST', From => $from, To => $to, Subject => 'Contact Response for <name> at <time>'); # Add the header $mime->head->add("X-SMTPAPI", $hdr->asJSON); # Add body $mime->attach(Type => 'text/plain', Encoding =>'-SUGGEST', Data => $plain); $mime->attach(Type => 'text/html', Encoding =>'-SUGGEST', Data => $html); # Login credentials my $username = 'apikey'; my $api_key = "your_api_key"; # Open a connection to the SendGrid mail server my $smtp = Net::SMTP->new('smtp.sendgrid.net', Port=> 587, Timeout => 20, Hello => "yourdomain.com"); # Authenticate $smtp->auth($username, $api_key); # Send the rest of the SMTP stuff to the server $smtp->mail($from); $smtp->to($to); $smtp->data($mime->stringify); $smtp->quit(); ``` ================================================ FILE: content/docs/for-developers/sending-email/smtp-php-code-example.md ================================================ --- layout: page weight: 0 title: SMTP PHP Code Example group: x-smtpapi navigation: show: true --- SendGrid recommends using our [PHP SMTPAPI library](https://github.com/sendgrid/smtpapi-php), full documentation can be found on GitHub. Our [PHP API library](https://github.com/sendgrid/sendgrid-php) allows you to fully integrate with SendGrid. ================================================ FILE: content/docs/for-developers/sending-email/smtp-python-code-example.md ================================================ --- layout: page weight: 0 title: SMTP Python Code Example group: x-smtpapi navigation: show: true --- SendGrid recommends using our [Python SMTPAPI library](https://github.com/sendgrid/smtpapi-python), full documentation can be found on GitHub. Our [Python SMTPAPI library](https://github.com/sendgrid/smtpapi-python) allows you to fully integrate with SendGrid. ================================================ FILE: content/docs/for-developers/sending-email/smtp-ruby-code-example.md ================================================ --- layout: page weight: 0 title: SMTP Ruby Code Example group: x-smtpapi navigation: show: true --- These examples require the [JSON Ruby Library](http://www.ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html). <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> ## SmtpApiHeader.rb This header is required for each example. ```ruby #!/usr/bin/ruby # Version 1.0 # Last Updated 6/22/2009 require 'json' class SmtpApiHeader def initialize() @data = {} end def addTo(to) @data['to'] ||= [] @data['to'] += to.kind_of?(Array) ? to : [to] end def addSubVal(var, val) if not @data['sub'] @data['sub'] = {} end if val.instance_of?(Array) @data['sub'][var] = val else @data['sub'][var] = [val] end end def setUniqueArgs(val) if val.instance_of?(Hash) @data['unique_args'] = val end end def setCategory(cat) @data['category'] = cat end def addFilterSetting(fltr, setting, val) if not @data['filters'] @data['filters'] = {} end if not @data['filters'][fltr] @data['filters'][fltr] = {} end if not @data['filters'][fltr]['settings'] @data['filters'][fltr]['settings'] = {} end @data['filters'][fltr]['settings'][setting] = val end def asJSON() json = JSON.generate @data return json.gsub(/(["\]}])([,:])(["\[{])/, '\\1\\2 \\3') end def as_string() json = asJSON() str = 'X-SMTPAPI: %s' % json.gsub(/(.{1,72})( +|$\n?)|(.{1,72})/,"\\1\\3\n") return str end end ``` ## Example Ruby Usage ```ruby require './SmtpApiHeader.rb' require 'mail' Mail.defaults do delivery_method :smtp, { :address => 'smtp.sendgrid.net', :port => 587, :domain => 'sendgrid.com', :user_name => 'apikey', :api_key => 'yourSendGridAPIKey', :authentication => 'plain', :enable_starttls_auto => true } end hdr = SmtpApiHeader.new receiver = ['recipienteexampexample@example.com', 'recipient2@domain.com'] hdr.addTo(receiver) hdr.setUniqueArgs({'test' => 1, 'foo' =>2}) hdr.setCategory('yourCategory') mail = Mail.deliver do header['X-SMTPAPI'] = hdr.asJSON() to 'willnotdeliver@domain.com' # When using SMTPAPI's 'to' parameter, this address will not get delivered to from 'yourEmailAddress@domain.com' subject 'Ruby Example using X-SMTPAPI header' text_part do body 'You would put your content here, but I am going to say: Hello world!' end html_part do content_type 'text/html; charset=UTF-8' body '<b>Hello world!</b><br>Glad to have you here!' end end ``` ================================================ FILE: content/docs/for-developers/sending-email/ssmtp.md ================================================ --- layout: page weight: 0 title: ssmtp group: mail-servers navigation: show: true --- Adding SendGrid as a SMTP relay for ssmtp is easy. Edit **/etc/ssmtp/ssmtp.conf** and add the following: ``` mailhub=smtp.sendgrid.net:587 AuthUser=apikey AuthPass=sendgridapikey UseSTARTTLS=YES ``` Your changes will come into effect as soon as the next message is sent via `ssmtp` ================================================ FILE: content/docs/for-developers/sending-email/stopping-a-scheduled-send.md ================================================ --- seo: title: Canceling a scheduled send description: Can I stop a scheduled email or campaign? keywords: pause, halt, delete, queue, stop, cancel, reschedule, unschedule title: Canceling a scheduled send group: api-v3 weight: 0 layout: page navigation: show: true --- If you have scheduled an email or a campaign to be sent, but decided to cancel or reschedule the email then you have several options. <call-out type="warning"> If you are looking for information on how to stop a send that is currently in progress, [click here]({{root_url}}/for-developers/sending-email/stopping-an-in-progress-send/)! </call-out> ## Canceling Transactional Email ### Cancel Scheduled Sends There is a [group of endpoints](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends) in the SendGrid API v3 that makes it possible to batch transactional email together and to schedule a time for that batch to be delivered. You can also pause or cancel the delivery of one of these batches. <call-out> You can have no more than 100 different batches (100 different groups of emails with each group identified by a unique `batch_id`) in a 'paused' or 'pending cancellation' state at one time. </call-out> To create a batch ID, assign that ID to an email or group of emails, and cancel the send, refer to the following steps: ### 1. Generate a Batch ID First, generate a batch id by calling the [v3/mail/batch endpoint](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends/create-a-batch-id). When successful, you should receive a 201 response along with your batch ID. `POST https://api.sendgrid.com/v3/mail/batch` ```json HTTP/1.1 201 { "batch_id": "YOUR_BATCH_ID" } ``` ### 2. Assign Batch ID to an Email The batch ID generated in step 1 can now be used when scheduling an email via the SendGrid API v3 by setting the value of `batch_id` to your new batch ID in a [v3/mail/send](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) request and setting the value of `send_at` to a UNIX timestamp representing the time you want your email sent. For example: `POST https://api.sendgrid.com/v3/mail/send` ```json { "personalizations": [ { "to": [ { "email": "john@example.com" } ], "subject": "Hello, World!" } ], "from": { "email": "from_address@example.com" }, "content": [ { "type": "text/plain", "value": "Hello, World!" } ], "send_at": 1484913600, "batch_id": "YOUR_BATCH_ID" } ``` ```json { HTTP/1.1 202 } ``` <call-out> If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. </call-out> ### 3. Cancel or Pause Your Send Now that your email has been scheduled and has a batch ID assigned, you can [pause or cancel the send](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends/cancel-or-pause-a-scheduled-send) at any time up to 10 minutes before the scheduled send time. <call-out type="warning"> Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. </call-out> To only pause your scheduled send, set the `status` parameter in your request to "pause". To completely cancel your request, set `status` to "cancel". When a Batch is **canceled**, all messages associated with that batch will stay in your sending queue, but when their `send_at` value is reached, they will be discarded instead of attempting delivery. When a Batch is **paused**, all messages associated with that batch will stay in your sending queue, even past their `send_at` value. Any messages that are more than 72 hours old will be discarded as Expired. `POST https://api.sendgrid.com/v3/user/scheduled_sends` ```json { "batch_id": "YOUR_BATCH_ID", "status": "pause" } ``` ```json HTTP/1.1 201 ``` For more details, please see our [Cancel Scheduled Sends API Reference](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends). ## Canceling a Marketing Campaign ### Using the User Interface <call-out> These directions refer to unscheduling a Single Send in the new Marketing Campaigns product. </call-out> If you scheduled a specific time to send your campaign, it's easy to unschedule this campaign to make changes or reschedule it. Simply navigate to your Campaigns page by clicking **Marketing Campaigns** in the left hand navigation menu and selecting **Single Sends**. Next to the Single Send you want to unschedule, click the action menu and select **Unschedule**. ### Using the API <call-out> These directions refer to unscheduling a Campaign in the legacy Marketing Campaigns product. </call-out> You can unschedule a campaign by making a call to [/v3/campaigns/{campaign_id}/schedules](https://sendgrid.api-docs.io/v3.0/cancel-scheduled-sends/cancel-or-pause-a-scheduled-send) where `{campaign_id}` is the ID of the campaign you want to unschedule. A successful unschedule will return a 204. **You cannot unschedule campaigns that are already in the process of being sent. You should instead cancel or delete the campaign.** `DELETE https://api.sendgrid.com/v3/campaigns/{campaign_id}/schedules` `HTTP/1.1 204` ================================================ FILE: content/docs/for-developers/sending-email/stopping-an-in-progress-send.md ================================================ --- seo: title: Stopping an in-progress send description: Can I stop a send in progress? keywords: pause, halt, delete, queue, stop, interrupt title: Stopping an in-progress send group: api-v3 weight: 0 layout: page zendesk_id: 204117516 navigation: show: true --- <call-out type="warning"> If you are looking for information on how to cancel a scheduled email or campaign, [click here]({{root_url}}/for-developers/sending-email/stopping-a-scheduled-send/)! </call-out> ## Stopping Transactional Email Stopping an ongoing send that is using SMTP or the Web API can be tricky, because we strive to accept and send email requests as quickly as possible. Sometimes stopping an accidental send is just not possible. However, following are several suggestions for how to halt a send in progress or a send that you have scheduled. ### 1. Change Your API Key or Password The simple act of changing your [API key](https://app.sendgrid.com/settings/api_keys) or [password](https://app.sendgrid.com/settings/account) can break your existing email integration by causing a mismatch between what your app is trying to authenticate with and what we have on record. This method is great if you have a runaway script or have just started a send accidentally. Be sure to verify that the credentials your app is using belong either to the parent account or a [teammate](https://app.sendgrid.com/settings/teammates) so you can change the proper one. Using an API key has the added benefit of breaking only the services for which it has permissions. In addition to enhanced security, the ease of change afforded by an API key is one reason we recommend using API keys to authenticate with our services. <call-out type="warning"> We cannot guarantee that changing your API key or password will prevent 100% of your email requests from being delivered. We only recommend this method as a last resort that may allow you to stop at least some of your emails from being sent. </call-out> ### 2. Contact Support Support has the ability to clear any emails currently pending delivery from your account. To be more clear, there is a very small window of opportunity between when we accept an email request and when we actually attempt delivery to the recipient. Emails can build up in this queue, and upon request, we can delete them entirely. ## Stopping a Marketing Campaign You have several options for canceling or unscheduling a campaign. ### Using the User Interface If you have **Send Immediately** under the **Scheduling** dropdown menu in the campaign builder set to OFF, then you only have a very brief window of opportunity to cancel the campaign after clicking **Send Campaign**. You have 2 options: 1. **Deleting the Campaign** Navigate to your [Campaigns page](https://sendgrid.com/marketing_campaigns/ui/campaigns). Find the campaign you want to stop, click the action menu and select **Delete**. 2. **Canceling the Campaign** Navigate to your [Campaigns page](https://sendgrid.com/marketing_campaigns/ui/campaigns). Find the campaign you want to stop and click the little red X next to the campaign name to cancel the campaign. Click **Confirm** in the confirmation window that appears. You'll see the status of your campaign change to "Canceled". ![]({{root_url}}/images/cancel_campaign_1.png) *** ![]({{root_url}}/images/cancel_campaign_2.png) *** ![]({{root_url}}/images/cancel_campaign_3.png) ### Using the SendGrid API #### New Marketing Campaigns You can cancel a scheduled send by making a call to [/marketing/singlesends/{id}/schedule](https://sendgrid.api-docs.io/v3.0/single-sends/delete-single-send-schedule) where `{id}` is the ID of the Single Send you want to stop. A successful deletion will return a 200. #### Legacy Marketing Campaigns You can delete a campaign by making a call to [/v3/campaigns/{campaign_id}](https://sendgrid.api-docs.io/v3.0/campaigns-api/unschedule-a-scheduled-campaign) where `{campaign_id}` is the ID of the campaign you want to stop. A successful deletion will return a 204. `DELETE https://api.sendgrid.com/v3/campaigns/{campaign_id}` `HTTP/1.1 204` ================================================ FILE: content/docs/for-developers/sending-email/substitution-tags.md ================================================ --- seo: title: Substitution Tags description: Section tags allow you to substitute in content for individual recipients in an SMTP message. keywords: SMTP, send email, Substitution tags title: Substitution Tags group: x-smtpapi weight: 10 layout: page navigation: show: true --- Substitution tags allow you to generate dynamic content for each recipient on your list. When you send to a list of recipients over SMTP API, you can specify substitution tags specific to each recipient. For example, a first name that will then be inserted into an opening greeting like the following, where each recipient sees -firstName- replaced with their first name. ```html "Dear -firstName-" ``` These tags can also be used in more complex scenarios. For example, you could use a -customerID- to build a custom URL that is specific to that user. ### A customer specific ID can replace -customerID- in the URL within your email ```html <a href="http://example.com/customerOffer?id=-customerID-">Claim your offer!</a> ``` <call-out> Substitution tags will work in the Subject line, body of the email and in [Unique Arguments]({{root_url}}/for-developers/sending-email/unique-arguments/). </call-out> <call-out type="warning"> Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> <call-out> Substitutions are limited to 10000 bytes per personalization block. </call-out> <call-out type="warning"> When passing substitutions please make sure to only use strings as shown in our examples. Any other type could result in unintended behavior. </call-out> How you format your substitution tags may depend on the library you use to create your SMTP connection, the language you are writing your code in, or any intermediate mail servers that your servers will send mail through. In some cases -subVal- may be the best choice while in other %subVal% or #subVal# may make more sense. It is best to avoid characters that have special meaning in HTML, such as <,>, and &. These might end up encoded and will not be properly substituted. <call-out> You can have up to 4 nested substitutions. </call-out> <call-out type="warning"> Do not use spaces inside your substitution tags, for example: `%first name%` </call-out> <call-out type="warning"> Do not nest substitution tags in substitutions as they will fail and your substitution will not take place. </call-out> ## Substitution Tag Example Email HTML content: ```html <html> <head></head> <body> <p> Hello -name-,<br /> Thank you for your interest in our products. I have set up an appointment to call you at -time- EST to discuss your needs in more detail. If you would like to reschedule this call, please visit the following link: `<a href="http://example.com/reschedule?id=-customerID-" >reschedule</a >` Regards, -salesContact- -contactPhoneNumber-<br /> </p> </body> </html> ``` <p>An accompanying SMTP API JSON header might look something like this:</p> ```json { "to": ["example@example.com", "example@example.com"], "sub": { "-name-": ["John", "Jane"], "-customerID-": ["1234", "5678"], "-salesContact-": ["Jared", "Ben"], "-contactPhoneNumber-": ["555.555.5555", "777.777.7777"], "-time-": ["3:00pm", "5:15pm"] } } ``` The resulting email for John would look like this: ```html <html> <head></head> <body> <p> Hello John,<br /> Thank you for your interest in our products. I have set up an appointment to call you at 3:00 pm EST to discuss your needs in more detail. If you would like to reschedule this call, please visit the following link: <a href="http://example.com/reschedule?id=1234">reschedule</a> Regards, Jared 555.555.5555 </p> </body> </html> ``` In contrast, the resulting email for Jane will look like the following, with her specific values replaced in for each tag: ```html <html> <head></head> <body> <p> Hello Jane,<br /> Thank you for your interest in our products. I have set up an appointment to call you at 5:15pm EST to discuss your needs in more detail. If you would like to reschedule this call please visit the following link: <a href="http://example.com/reschedule?id=5678">reschedule</a> Regards, Ben 777.777.7777 </p> </body> </html> ``` ## SendGrid Defined Substitution Tags While the tags above are tags that you define at the time of your send in the SMTP API headers, SendGrid also offers [Unsubscribe Groups tags]({{root_url}}/ui/sending-email/create-and-edit-transactional-templates/) that have been pre-defined for you. You can use these tags within the content of your email, and you do not have to and should not, define them. ## Additional Resources - [Section Tags]({{root_url}}/for-developers/sending-email/section-tags/) - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) ================================================ FILE: content/docs/for-developers/sending-email/sugarcrm.md ================================================ --- seo: title: SugarCRM Integration description: SugarCRM Integration keywords: CRM, sugarCRM, integration, smtp title: SugarCRM Integration group: plugins weight: 0 layout: page zendesk_id: 200182078 navigation: show: false --- ## What is SugarCRM? One of the primary competitors to the Salesforce CRM, [SugarCRM](http://www.sugarcrm.com/) is a widely used customer relationship management software and as they explain on their website, "[SugarCRM is] designed to help your business communicate with prospects, share sales information, close deals and keep customers happy. Thousands of successful companies use Sugar everyday to manage sales, marketing and support." Since SendGrid has become synonymous with optimized deliverability of transactional email to the inbox, some of our customers have asked us how they can send mail from their CRM software through our service so those emails can also be optimized for deliverability to the inbox. If you're a SendGrid as well as SugarCRM customer, let's get into how you'll go about doing this! ## How do I integrate SugarCRM with SendGrid SendGrid customers utilizing our service for their transactional email and wanting to use SugarCRM for their email marketing campaigns can easily make a few settings changes within their SugarCRM account in order to point their outgoing mail to us, so we can deliver it to the end recipient. In order to send mail from SugarCRM to SendGrid, navigate the following on the SugarCRM site: **Admin** > **Email Settings** and choose **SMTP** as the mail transfer agent. Then enter the required server info as follows: - **SMTP Hostname** : smtp.sendgrid.net - **SMTP Username** : 'apikey' - **SMTP Password** : [your SendGrid API key] - **SMTP Port** : [the port of your choosing, the options for which can be found [here]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/#smtp-ports)] Note that the SMTP username is the string, "apikey" and not your account username. Using "apikey" as the username is required when using an API key as the password via Basic Authentication. Once these changes have been made within the Email Settings page within your SugarCRM account, all outgoing mail from the application will be routed to SendGrid so we can send it to the end recipient. SugarCRM outlines this process in more detail in their own support documentation [here](<http://support.sugarcrm.com/04_Find_Answers/02KB/02Administration/100Email/Configuring_Your_Outbound_Email_Server_(SMTP)_to_Work_With_Sugar>). ================================================ FILE: content/docs/for-developers/sending-email/suppressions.md ================================================ --- seo: title: Suppression Groups description: Suppression groups allow you to set up unsubscribe lists and options keywords: SMTP, suppression groups, unsubscribe lists title: Suppression Groups group: x-smtpapi weight: 10 layout: page navigation: show: true --- ## Defining an Unsubscribe Group When Sending The method used to specify an unsubscribe group for an email depends on how you will be sending that email: - When sending an SMTP message, add the group's ID to the X-SMTPAPI header. - When sending an email via the [Web API v2](https://www.twilio.com/docs/sendgrid/api/v2/mail), add the group's ID in the `x-smtpapi` parameter. - When sending an email via the [Web API v3](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send), define the group's ID in the `asm.group_id` parameter. <call-out type="warning"> You may only specify one group per send, and you should wait one minute after creating the group before sending with it. </call-out> <call-out type="warning"> When passing `asm_group_id` please make sure to only use integers as shown in our examples. Any other type could result in unintended behavior. </call-out> ```json { "asm_group_id": 1 } ``` ## Defining Unsubscribe Groups to display on the Manage Preferences page To specify which groups to display on the Manage Preferences page of an email, add the group IDs to the X-SMTPAPI header of an SMTP message, or in the x-smtpapi parameter of a [mail.send API call](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). If you omit the `asm_groups_to_display` header, your default groups is shown on the Manage Preferences page instead. <call-out type="warning"> You can specify up to 25 groups to display. </call-out> ```json { "asm_groups_to_display": [1, 2, 3] } ``` ## Groups You can find your group IDs by looking at the Group ID column in the Unsubscribe Groups UI, or by calling the [GET method](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups/retrieve-all-suppression-groups-associated-with-the-user) of the groups resource. Related Articles: - You can create Unsubscribe groups via the [API V3 > Unsubscribe Groups Endpoint](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups/create-a-new-suppression-group). ## Additional Resources - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) ================================================ FILE: content/docs/for-developers/sending-email/symfony.md ================================================ --- layout: page weight: 0 group: frameworks title: Symfony seo: title: Send Email with Symfony & SendGrid description: View instructions on how to easily send email with Symfony using SendGrid, by setting up setting up or extending SwiftMailer. navigation: show: true --- Symfony uses SwiftMailer to send email, read more about [sending emails from Symfony](https://symfony.com/doc/current/email.html). To get started you need to modify parameters.yml and add the following: ``` mailer: class: sfMailer param: logging: %SF_LOGGING_ENABLED% charset: %SF_CHARSET% delivery_strategy: realtime transport: class: Swift_SmtpTransport param: host: smtp.sendgrid.net port: 587 encryption: ~ username: sendgridusername api_key: sendgrid_api_key ``` After that you should be able to send emails. The following shows an example: ``` php <?php $message = Swift_Message::newInstance() ->setFrom('from@example.com') ->setTo('to@example.com') ->setSubject('Subject') ->setBody('Body'); $this->getMailer()->send($message); ?> ``` ### Another Option If you want more flexibility, you can use partials to define the content of the emails. Add the a class such as **lib/myEmail.class.php**. ``` php <?php class myEmail { /** * Library to facilitate email messages being sent out, sendMail deprecated in symfony 1.2 * * @param string $partial - Array with html and text partials ie array('text'=>'textPartial', 'html'=>'htmlPartial') * @param array $parameters - Array we will pass into the partials * @param string $mailFrom - Email source * @param string $mailTo - Email destination * @param string $subject - The subject of the email message * @param array $sgHeaders - What we will be placing in the SMTPAPI header. Must be null or a non-empty array * @param array $attachments - Email contains the attachments */ public static function sendEmail($partials, $parameters, $mailFrom, $mailTo, $subject, $sgHeaders = null, $attachments = null) { // verify we have username/api_key to send out emails - IMPORTANT if (!sfconfig::has('app_sendgrid_username') or !sfconfig::has('app_sendgrid_api_key')) { throw new sfException('SMTP username/api_key is required to send email out'); } $text = null; $html = null; if (is_array($partials)) { // load libraries sfContext::getInstance()->getConfiguration()->loadHelpers('Partial'); if (isset($partials['text'])) { $text = get_partial($partials['text'], $parameters); } if (isset($partials['html'])) { $html = get_partial($partials['html'], $parameters); } } if ($text === null && $html === null) { throw new sfException('A text and/or HTML partial must be given'); } try { /* * Load connection for mailer */ $connection = Swift_SmtpTransport::newInstance('smtp.sendgrid.net', 465, 'ssl')->setUsername(sfconfig::get('app_sendgrid_username'))->setPassword(sfconfig::get('app_sendgrid_api_key')); // setup connection/content $mailer = Swift_Mailer::newInstance($connection); $message = Swift_Message::newInstance()->setSubject($subject)->setTo($mailTo); if ($text && $html) { $message->setBody($html, 'text/html'); $message->addPart($text, 'text/plain'); } else if ($text) { $message->setBody($text, 'text/plain'); } else { $message->setBody($html, 'text/html'); } // if contains SMTPAPI header add it if (null !== $sgHeaders) { $message->getHeaders()->addTextHeader('X-SMTPAPI', json_encode($sgHeaders)); } // update the from address line to include an actual name if (is_array($mailFrom) and count($mailFrom) == 2) { $mailFrom = array( $mailFrom['email'] => $mailFrom['name'] ); } // add attachments to email if ($attachments !== null and is_array($attachments)) { foreach ($attachments as $attachment) { $attach = Swift_Attachment::fromPath($attachment['file'], $attachment['mime'])->setFilename($attachment['filename']); $message->attach($attach); } } // Send $message->setFrom($mailFrom); $mailer->send($message); } catch (Exception $e) { throw new sfException('Error sending email out - ' . $e->getMessage()); } } } ?> ``` Then configure your credentials on **apps/frontend/app.yml** ``` prod: sendgrid: username: sendgridusername password: sendgrid_api_key ``` Now can put your partials in a module such as **apps/frontend/modules/mail**. For example, to send a registration email in both text and HTML, we would have the following structure: ``` apps/ frontend/ modules/ mail/ _registrationHTML.php _registrationTEXT.php ``` Add this to **apps/frontend/modules/mail/_registrationTEXT.php** ``` php Dear <!--?php echo $name ?-->, Thank you for registering. Please go to http://domain.com to finish your registration. ``` Add this to **apps/frontend/modules/mail/_registrationHTML.php** ``` php Dear <!--?php echo $name ?-->, Thank you for registering. Please go to <a href="http://domain.com">here</a> to finish your registration. ``` And send the message as follow: ``` php <?php myEmail::sendEmail(array('text'=>'mail/registrationTEXT', 'html'=>'mail/registrationHTML'), array('name'=>'Recipient Name'), 'youremail@domain.com', 'recipient@example.com', 'Registration Information'); ?> ``` ================================================ FILE: content/docs/for-developers/sending-email/thunderbird.md ================================================ --- layout: page weight: 0 title: Thunderbird group: mail-clients navigation: show: true --- To send email using Thunderbird you will have to modify your outgoing server settings in Thunderbird accordingly. Additionally you can modify settings in Thunderbird that will allow you to include an [SMTP API]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) header in your emails if you wish to leverage [categories]({{root_url}}/ui/analytics-and-reporting/categories/) or other features of the SMTP API when sending mail via the Thunderbird client. ## Getting started 1. Navigate to **Tools** and select **Account Settings**. ![]({{root_url}}/images/thunderbird_1.png "thunderbird_add") 2. Enter the following settings: * **Description -** SendGrid Connection * **Server Name -** smtp.sendgrid.net * **Port -** 465 * **Connection security -** SSL/TLS * **Authentication method -** Normal password * **User Name -** apikey * **Password -** Your SendGrid API key. (You can read more about authenticating with an API key at [this link](https://sendgrid.com/docs/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/#upgrade-to-api-keys-for-your-smtp-integration)) ![]({{root_url}}/images/thunderbird_2.png "thunderbird_settings") ## Incorporating SMTP API headers *To incorporate SMTP API headers:* 1. Select **Tools** > **Options** (Win) or **Thunderbird** > **Preferences** (Mac) from the menu in Thunderbird. 1. Click **Advanced**. 1. Select **General** and click **Config Editor**. ![]({{root_url}}/images/thunderbird_3.png "thunderbird_advanced") 4. Enter "mail.compose.other.header" under "Filter:" 5. Double-click **mail.compose.other.header**. 6. Enter "X-SMTPAPI" 7. Click **OK**. 8. Close the configuration editor and preferences dialog. ![]({{root_url}}/images/thunderbird_4.png "thunderbird_header") 9. Restart Thunderbird Create a mail message and just like you would add a CC or BCC to your email, click the drop down option that will now allow you to add a header of the type "X-SMTPAPI" in addition to "To". ![]({{root_url}}/images/thunderbird_5.png "thunderbird_compose") ================================================ FILE: content/docs/for-developers/sending-email/unique-arguments.md ================================================ --- seo: title: Unique Arguments description: Add unique arguments to customize your SMTP emails event tracking keywords: SMTP, unique arguments, email events, email activity title: Unique Arguments group: x-smtpapi weight: 10 layout: page navigation: show: true --- <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> The SMTP API JSON string allows you to attach an unlimited number of unique arguments to your email **up to 10,000 bytes**. The arguments are used only for tracking. They can be retrieved through the [Event API]({{root_url}}/for-developers/tracking-events/event/) or the [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) page. <call-out type="warning"> When passing `unique_args` please make sure to only use strings as shown in our examples. Any other type could result in unintended behavior. </call-out> These arguments can be added using a JSON string like this: ```json { "unique_args": { "customerAccountNumber": "55555", "activationAttempt": "1", "New Argument 1": "New Value 1", "New Argument 2": "New Value 2", "New Argument 3": "New Value 3", "New Argument 4": "New Value 4" } } ``` These arguments can then be seen in posts from the [SendGrid Event Webhook]({{root_url}}/for-developers/tracking-events/event/). The contents of one of these POST requests would look something like this: ### Example Webhook Post Data ```json { "sg_message_id": "145cea24eb8.1c420.57425.filter-132.3382.5368192A3.0", "New Argument 1": "New Value 1", "event": "processed", "New Argument 4": "New Value 4", "email": "useexampexample@example.com", "email": "example@example.com", "smtp-id": "<145cea24eb8.1c420.57425@localhost.localdomain>", "timestamp": 1399331116, "New Argument 2": "New Value 2", "New Argument 3": "New Value 3", "customerAccountNumber": "55555", "activationAttempt": "1" } ``` <call-out type="warning"> Bounces returned with the Return-Path cause `unique_rgs not to be attached to an event. This can cause issues when developing unique_args POST handling. </call-out> To apply different unique arguments to individual emails, you may use [substitution tags]({{root_url}}/for-developers/sending-email/substitution-tags/). An example of this would look like: ```json { "sub": { "-account_number-": ["314159", "271828"] }, "unique_args": { "customerAccountNumber": "-account_number-" } } ``` ## Additional Resources - [SMTP Service Crash Course](https://sendgrid.com/blog/smtp-service-crash-course/) - [Getting Started with the SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) - [Integrating with SMTP]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/) - [Building an SMTP Email]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) ================================================ FILE: content/docs/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys.md ================================================ --- seo: title: Upgrade your authentication method to API keys description: How to upgrade your authentication methods in your code to use API keys keywords: Authentication, authorization, API key title: Upgrade your authentication method to API keys group: sending-email weight: 0 layout: page navigation: show: true --- <call-out type="warning"> Two-Factor Authentication is required as of Q4 2020, and all Twilio SendGrid API endpoints will reject new API requests and SMTP configurations made with a username and password via Basic Authentication. </call-out> ## Am I Using Basic Authentication with Username and Password? - If SMTP: Check the username you're using to authenticate. If it's the word "apikey" then you're using an API Key. If it's not, then you're using username and password authentication. - If V3: If you're using the most recent version of our open sourced libraries and followed the documentation, you should already be using API keys. If you aren't using our libraries, check the Authorization header on your API calls. If you see the word "Bearer" - you're good. If you see the word "Basic" you're using username and password. - If V2 non-mail send: You're using username and passwords. - If Premier 50M and below package: Use the [Email Activity API](https://sendgrid.api-docs.io/v3.0/email-activity/) to identify mail/send API Key usage. If the `api_key_id` parameter is empty, you will need to upgrade your authentication. ## Why should I use API Keys for authentication? Using your account username and password for authentication is less secure than using an API Key. API Keys are preferred because you can limit permissions for API Keys and revoke them at any time. We recommend applying the principle of least privilege, using limited API Key permission to only provide access to what is needed for that request for maximum security. For more about protecting your account, see our blog post, [7 Best Practices to Protect your Twilio SendGrid Account and Sending Reputation](https://sendgrid.com/blog/7-best-practices-to-protect-your-twilo-sendgrid-account-and-sending-reputation/). To learn more about the principle of least privilege, see our [Twilio blog post](https://www.twilio.com/blog/principle-of-least-privilege-details-best-practices) and [OWASP's article on Access Control](https://owasp.org/www-community/Access_Control). ## Tips for upgrading to API Keys - Prioritize upgrading your authentication method to API Keys for your mail/send endpoints first - Store your API Keys in an [environment variable]({{root_url}}/ui/account-and-settings/api-keys/#storing-an-api-key-in-an-environment-variable) - Test these changes in a staging environment before rolling out to your production environment ## Upgrade to API Keys for your API endpoint requests Follow these steps to identify and replace your authentication method to API Keys and then implement 2FA for enhanced security. 1. Identify where you are storing your username and password credentials for basic authentication. Your credentials could be stored in environment variables or hard coded depending on how you integrated. 1. Generate API Keys in the SendGrid UI or programmatically with the least privileged permissions required for each of the endpoints you will be updating. For more information, see [API Key Permissions]({{root_url}}/ui/account-and-settings/api-keys/#api-key-permissions). 1. Replace your username and password credentials with API Keys. - For v3 API: Follow [these instructions](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-authentication). - For v2: Follow [these instructions](https://www.twilio.com/docs/sendgrid/api/v2/mail#sending-email). ## Upgrade to API Keys for your SMTP integration 1. Generate API Keys in the [SendGrid UI](https://app.sendgrid.com/settings/api_keys) or [programmatically](https://sendgrid.api-docs.io/v3.0/api-keys/create-api-keys) with the least privileged permissions required for each of the endpoints you will be updating. For more information, see [API Key Permissions]({{root_url}}/ui/account-and-settings/api-keys/#api-key-permissions). To send email only, your API key will require **Mail Send** > **Full Access** permissions. 2. To use your API key with the SMTP integration, you must set your username to the string, `apikey`. Your password will be the API key you generated in the previous step. ``` user_name: "apikey" password: <Your API Key> ``` <call-out> When submitting base64 encoded API key values, be sure you have not included any newline or whitespace characters by accident. This can happen when copying the encoded key from an environment that line wraps output. SMTP is a line-oriented protocol, and linefeed characters will prevent you from authenticating successfully. </call-out> Once the previous steps are completed, enable Two-Factor Authentication for all of your users, including [subusers]({{root_url}}/ui/account-and-settings/subusers/) and [teammates]({{root_url}}/ui/account-and-settings/teammates/). If you are new to our SMTP integration, you will find more integration instructions at [Integrating with the SMTP API]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/). ## Check for API rejections After enabling 2FA monitor your API calls for rejections related to continued use of username and password authentication. ### Error message for API calls: `invalid authentication method` - declined because you are using basic authentication with 2FA enabled. to fix, update to using an API key or disable 2FA and switch to using IP Access Management for security. for more information, see https://sendgrid.com/docs/for-developers/sending-email/authentication/#basic-authentication ### Error message for SMTP: SMTP error message is: `535 Authentication failed: Basic authentication is not allowed with 2FA enabled`. To fix, see https://sendgrid.com/docs/for-developers/sending-email/authentication/#basic-authentication For more information on how to secure your Twilio SendGrid account visit this [blog post](https://sendgrid.com/blog/7-best-practices-to-protect-your-twilo-sendgrid-account-and-sending-reputation/). ================================================ FILE: content/docs/for-developers/sending-email/using-handlebars.md ================================================ --- layout: page weight: 50 title: Using Handlebars group: api-v3 navigation: show: true seo: title: Using Handlebars override: true description: --- Twilio SendGrid [Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) and [Marketing Campaigns designs]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/) support the [Handlebars](https://handlebarsjs.com/) templating language to render the [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) you send via the API and the [Substitution Tags]({{root_url}}/for-developers/sending-email/substitution-tags/) stored on your Marketing Campaigns contacts. Handlebars syntax allows you to personalize the messages in your templates by inserting customers' names and other data to make an email relevant to each individual recipient. For example, if you have a customer's name stored in a JSON property called `"name"`, you can insert the property's value into a template by adding `{{ name }}` wherever you want the customer's name to appear. Handlebars syntax allows all of this dynamic templating to occur outside of your code base, meaning changes are done quickly in the template with no update to a code base required. <call-out> If you prefer to use your own templating system, you can still insert dynamic data using [Substitution Tags](/ui/sending-email/substitution-and-section-tags/). </call-out> ## Personalizing email with Handlebars <call-out> You can manage your templates programmatically with our [Mail Send with Dynamic Transactional Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates). </call-out> The Handlebars language provides many features in addition to basic variable replacement, including iterations (loops) and conditional statements. Our templates and designs support most but not all of this Handlebars functionality. Currently, dynamic templates support the following helpers: - [Substitution](#substitution) - [Conditional statements](#conditional-statements) - [Iterations](#iterations) For a full helper reference, see the [Handlebars reference](#handlebars-reference) on this page. ## Use cases The following use case examples come from the [dynamic-template section of our email templates GitHub repo](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates). Each example links to files you can explore on GitHub. You can also work with these templates by uploading them using the [Code Editor]({{root_url}}/ui/sending-email/editor/#the-code-editor) available in [Dynamic Transactional Templates](https://mc.sendgrid.com/dynamic-templates) and the [Marketing Campaigns Design Library](https://mc.sendgrid.com/design-library/your-designs). The following use cases are listed with the Handlebars helpers used to build them. ### Receipt This [example receipt template](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/receipt) uses the following helpers: - [Substitution](#substitution) - [Conditional statements](#conditional-statements) - [Iterations](#iterations) ### Password reset This [example transactional template](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/transactional-actions) uses the following helpers: - [Substitution](#substitution) ### Multiple languages This is an [example template that lets you have content in multiple languages](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/different-languages), and it uses the following helpers: - [Conditional statements](#conditional-statements) - `if/else` ### Newsletter This [example newsletter template](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/newsletter) uses the following helpers: - [Substitution](#substitution) - [Iterations](#iterations) ### Advertisement This is an [example template that is advertising items on sale](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/special-sale), and it uses the following helpers: - [Substitution](#substitution) - [Conditional statements](#conditional-statements) - `if/else` - [Iterations](#iterations) ## Handlebars reference The following reference provides sample code blocks for each helper, including HTML email snippets and JSON test data. The code examples are shown in three tabs. The first tab, Handlebars, shows the Handlebars tag. The second tab, JSON, shows example data that would be used to populate the Handlebars tag. The third tab, HTML, shows the final output that the Handlebars tag will be rendered to in your email. You can click each tab to switch between the code samples. ### Substitution Twilio SendGrid templates support the following substitutions: - [Basic replacement](#basic-replacement) - [Deep object replacement](#deep-object-replacement) - [Object failure](#object-failure) - [Replacement with HTML](#replacement-with-html) - [formatDate](#formatdate) - [Insert](#insert) #### Basic replacement <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p>Hello {{ firstName }}</p> ``` ```json // Test data { "firstName": "Ben" } ``` ```html <!-- Resulting HTML !--> <p>Hello Ben</p> ``` </code-group> #### Deep object replacement <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p>Hello {{user.profile.firstName}}</p> ``` ```json // Test data { "user": { "profile": { "firstName": "Ben" } } } ``` ```html <!-- Resulting HTML --> <p>Hello Ben</p> ``` </code-group> #### Object failure <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p>Hello {{user.profile.firstName}}</p> ``` ```json // Test data { "user": { "orderHistory": [ { "date": "2/1/2018", "item": "shoes" }, { "date": "1/4/2017", "item": "hat" } ] } } ``` ```html <!-- Resulting HTML --> <p>Hello</p> ``` </code-group> #### Replacement with HTML <call-out type="warning"> If you include the characters `'`, `"` or `&` in a subject line replacement be sure to use three brackets like below. </call-out> <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <!-- Per Handlebars' documentation: If you don't want Handlebars to escape a value, use the "triple-stash", {{{ --> <p>Hello {{{firstName}}}</p> ``` ```json // Test data { "firstName": "<strong>Ben</strong>" } ``` ```html <!-- Resulting HTML --> <p>Hello <strong>Ben</strong></p> ``` </code-group> #### formatDate The formatDate helper takes a time in either epoch or ISO8601 format and converts it to a format you specify using the tokens in the following table. If you send a date field without converting it, it will be displayed in ISO8601 format with the full timestamp (e.g., `2020-01-01T23:00:00.000Z`). The following example display results are for Tuesday, January 1st, 2020 3:00:00PM Pacific Standard Time. <table> <tr> <th> Token </th> <th> Displayed Result </th> </tr> <tr> <td>YYYY</td> <td>2020</td> </tr> <tr> <td>YY</td> <td>20</td> </tr> <tr> <td>MMMM</td> <td>January</td> </tr> <tr> <td>MMM</td> <td>Jan</td> </tr> <tr> <td>MM</td> <td>01</td> </tr> <tr> <td>M</td> <td>1</td> </tr> <tr> <td>DD</td> <td>01</td> </tr> <tr> <td>D</td> <td>1</td> </tr> <tr> <td>dddd</td> <td>Tuesday</td> </tr> <tr> <td>ddd</td> <td>Tue</td> </tr> <tr> <td>hh</td> <td>03</td> </tr> <tr> <td>h</td> <td>3</td> </tr> <tr> <td>HH</td> <td>00</td> </tr> <tr> <td>H</td> <td>00</td> </tr> <tr> <td>mm</td> <td>00</td> </tr> <tr> <td>m</td> <td>0</td> </tr> <tr> <td>ss</td> <td>00</td> </tr> <tr> <td>s</td> <td>0</td> </tr> <tr> <td>A</td> <td>PM</td> </tr> <tr> <td>ZZ</td> <td>-0800</td> </tr> <tr> <td>Z</td> <td>-08:00</td> </tr> </table> <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template without timezone offset --> <p>Join us {{formatDate timeStamp dateFormat}}</p> <!-- Template with timezone offset --> <p>Join us {{formatDate timeStamp dateFormat timezoneOffset}}</p> ``` ```json // Test data { "timeStamp": "2020-01-01T23:00:00.000Z", "dateFormat": "MMMM:DD:HH:mm:ss", "timezoneOffset": "-0800" } ``` ```html <!-- Resulting HTML without timezone--> <p>Join us January 01, 2020 11:00:00PM</p> <!-- Resulting HTML with timezone--> <p>Join us January 01, 2020 3:00:00PM</p> ``` </code-group> #### Insert <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Insert with a default value --> <p>Hello {{insert name "default=Customer"}}! Thank you for contacting us about {{insert businessName "your business"}}.</p> ``` ```json // Test data with all values { "name": "Ben", "businessName": "Twilio SendGrid" } // Test data with missing value { "name": "Ben" } ``` ```html <!-- Resulting HTML with all values --> <p>Hello Ben! Thank you for contacting us about Twilio SendGrid.</p> <!-- Resulting HTML with missing value and a default--> <p>Hello Ben! Thank you for contacting us about your business.</p> ``` </code-group> ### Conditional statements Twilio SendGrid templates support the following conditionals: - [Basic If, Else, Else If](#basic-if-else-else-if) - [If with a root](#if-with-a-root) - [Unless](#unless) - [greaterThan](#greaterthan) - [lessThan](#lessthan) - [Equals](#equals) - [notEquals](#notequals) - [And](#and) - [Or](#or) - [Length](#length) #### Basic If, Else, Else If <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#if user.profile.male}} <p>Dear Sir</p> {{else if user.profile.female}} <p>Dear Madame</p> {{else}} <p>Dear Customer</p> {{/if}} ``` ```json // Test data one { "user":{ "profile":{ "male":true } } } // Test data two { "user":{ "profile":{ "female":true } } } // Test data three { "user":{ "profile":{ } } } ``` ```html <!-- Resulting HTML from test data one --> <p>Dear Sir</p> <!-- Resulting HTML from test data two --> <p>Dear Madame</p> <!-- Resulting HTML from test data three --> <p>Dear Customer</p> ``` </code-group> #### If with a root <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#if user.suspended}} <p>Warning! Your account is suspended, please call: {{@root.supportPhone}}</p> {{/if}} ``` ```json // Test data { "user": { "suspended": true }, "supportPhone": "1-800-555-5555" } ``` ```html <!-- Resulting HTML --> <p>Warning! Your account is suspended, please call: 1-800-555-5555</p> ``` </code-group> #### Unless <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#unless user.active}} <p>Warning! Your account is suspended, please call: {{@root.supportPhone}}</p> {{/unless}} ``` ```json // Test data { "user": { "active": false }, "supportPhone": "1-800-555-5555" } ``` ```html <!-- Resulting HTML --> <p>Warning! Your account is suspended, please call: 1800-555-5555</p> ``` </code-group> #### greaterThan ##### Basic greaterThan <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#greaterThan scoreOne scoreTwo}} Congratulations, you have the high score today! {{/greaterThan}} Thanks for playing. </p> ``` ```json // Test data one { "scoreOne": 100, "scoreTwo": 78 } // Test data two { "scoreOne": 55, "scoreTwo": 78 } ``` ```html <!-- Resulting HTML from test data one--> <p> Hello Ben! Congratulations, you have the high score today! Thanks for playing. </p> <!-- Resulting HTML from test data two--> <p>Hello Ben! Thanks for playing.</p> ``` </code-group> ##### greaterThan with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#greaterThan scoreOne scoreTwo}} Congratulations, you have the high score today! {{else}} You were close, but you didn't get the high score today. {{/greaterThan}} Thanks for playing. </p> ``` ```json // Test data one { "scoreOne": 100, "scoreTwo": 78 } // Test data two { "scoreOne": 55, "scoreTwo": 78 } ``` ```html <!-- Resulting HTML from test data one--> <p> Hello Ben! Congratulations, you have the high score today! Thanks for playing. </p> <!-- Resulting HTML from test data two--> <p> Hello Ben! You were close, but you didn't get the high score today. Thanks for playing. </p> ``` </code-group> #### lessThan ##### Basic lessThan <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#lessThan scoreOne scoreTwo}} You were close, but you didn't get the high score today. {{/lessThan}} Thanks for playing. </p> ``` ```json // Test data one { "scoreOne": 55, "scoreTwo": 78 } // Test data two { "scoreOne": 100, "scoreTwo": 78 } ``` ```html <!-- Resulting HTML from test data one--> <p> Hello Ben! You were close, but you didn't get the high score today. Thanks for playing. </p> <!-- Resulting HTML from test data two--> <p>Hello Ben! Thanks for playing.</p> ``` </code-group> ##### lessThan with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#lessThan scoreOne scoreTwo}} You were close, but you didn't get the high score today. {{else}} Congratulations, you have the high score today! {{/lessThan}} Thanks for playing. </p> ``` ```json // Test data one { "scoreOne": 55, "scoreTwo": 78 } // Test data two { "scoreOne": 100, "scoreTwo": 78 } ``` ```html <!-- Resulting HTML from test data one--> <p> Hello Ben! You were close, but you didn't get the high score today. Thanks for playing. </p> <!-- Resulting HTML from test data two--> <p> Hello Ben! Congratulations, you have the high score today! Thanks for playing. </p> ``` </code-group> #### Equals The `equals` comparison can check for equality between two values of the same data type. The `equals` helper will also attempt to coerce data types to make a comparison of values independent of their data type. For example, `{{#equals 3 "3"}}` will evaluate to `true`. <call-out type="warning"> Please be aware that the editor's Preview page will not properly render the results of a comparison between coerced values. You will see proper comparisons between coerced values only in a delivered message. </call-out> When checking for truthiness, be aware that empty strings, zero integers, and zero floating point numbers evaluate to `false`. Non-empty strings, non-zero integers, and non-zero floating point numbers, including negative numbers, evaluate to `true`. ##### Basic equals <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#equals customerCode winningCode}} You have a winning code. {{/equals}} Thanks for playing. </p> ``` ```json // Test data one { "customerCode": 289199, "winningCode": 289199 } // Test data two { "customerCode": 167320, "winningCode": 289199 } ``` ```html <!-- Resulting HTML from test data one--> <p>Hello Ben! You have a winning code. Thanks for playing.</p> <!-- Resulting HTML from test data two--> <p>Hello Ben! Thanks for playing.</p> ``` </code-group> ##### Equals with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#equals customerCode winningCode}} You have a winning code. {{else}} You do not have a winning code. {{/equals}} Thanks for playing. </p> ``` ```json // Test data one { "customerCode": 289199, "winningCode": 289199 } // Test data two { "customerCode": 167320, "winningCode": 289199 } ``` ```html <!-- Resulting HTML from test data one--> <p>Hello Ben! You have a winning code. Thanks for playing.</p> <!-- Resulting HTML from test data two--> <p>Hello Ben! You do not have a winning code. Thanks for playing.</p> ``` </code-group> #### notEquals The `notEquals` comparison can check for equality between two values of the same data type. The `notEquals` helper will also attempt to coerce data types to make a comparison of values independent of their data type. For example, {{#equals 3 "3"}} will return `false`. When checking for truthiness, be aware that empty strings, zero integers, and zero floating point numbers evaluate to `false`. Non-empty strings, non-zero integers, and non-zero floating point numbers, including negative numbers, evaluate to `true`. ##### Basic notEquals <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#notEquals customerCode winningCode}} You have a winning code. {{/notEquals}} Thanks for playing. </p> ``` ```json // Test data one { "customerCode": 289199, "winningCode": 289199 } // Test data two { "customerCode": 167320, "winningCode": 289199 } ``` ```html <!-- Resulting HTML from test data one--> <p>Hello Ben! You have a winning code. Thanks for playing.</p> <!-- Resulting HTML from test data two--> <p>Hello Ben! Thanks for playing.</p> ``` </code-group> ##### notEquals with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#notEquals customerCode winningCode}} You have a winning code. {{else}} You do not have a winning code. {{/notEquals}} Thanks for playing. </p> ``` ```json // Test data one { "customerCode": 289199, "winningCode": 289199 } // Test data two { "customerCode": 167320, "winningCode": 289199 } ``` ```html <!-- Resulting HTML from test data one--> <p>Hello Ben! You have a winning code. Thanks for playing.</p> <!-- Resulting HTML from test data two--> <p>Hello Ben! You do not have a winning code. Thanks for playing.</p> ``` </code-group> #### And When checking for truthiness, be aware that empty strings, zero integers, and zero floating point numbers evaluate to `false`. Non-empty strings, non-zero integers, and non-zero floating point numbers, including negative numbers, evaluate to `true`. ##### And without else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#and favoriteFood favoriteDrink}} Thank you for letting us know your dining preferences. {{/and}}. We look forward to sending you more delicious recipes.</p> ``` ```json // Test data one { "favoriteFood": "Pasta", "favoriteDrink": "" } // Test data two { "favoriteFood": "Pasta", "favoriteDrink": "Coffee" } ``` ```html <!-- Resulting HTML from test data one --> <p>Hi Ben! We look forward to sending you more delicious recipes.</p> <!-- Resulting HTML from test data two --> <p> Hi Ben! Thank you for letting us know your dining preferences. We look forward to sending you more delicious recipes. </p> ``` </code-group> ##### And with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#and favoriteFood favoriteDrink}} Thank you for letting us know your dining preferences. {{else}} If you finish filling out your dining preferences survey, we can deliver you recipes we think you'll be most interested in. {{/and}}. We look forward to sending you more delicious recipes.</p> ``` ```json // Test data one { "favoriteFood": "Pasta", "favoriteDrink": "" } // Test data two { "favoriteFood": "Pasta", "favoriteDrink": "Coffee" } ``` ```html <!-- Resulting HTML from test data one --> <p> Hi Ben! If you finish filling out your dining preferences survey, we can deliver you recipes we think you'll be most interested in. We look forward to sending you more delicious recipes. </p> <!-- Resulting HTML from test data two --> <p> Hi Ben! Thank you for letting us know your dining preferences. We look forward to sending you more delicious recipes. </p> ``` </code-group> #### Or When checking for truthiness, be aware that empty strings, zero integers, and zero floating point numbers evaluate to `false`. Non-empty strings, non-zero integers, and non-zero floating point numbers, including negative numbers, evaluate to `true`. ##### Basic or <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#or isRunner isCyclist}} We think you might enjoy a map of trails in your area. {{/or}}. Have a great day. </p> ``` ```json // Test data one { "isRunner": true, "isCyclist": false } // Test data two { "isRunner": false, "isCyclist": false } // Test data three { "isRunner": false, "isCyclist": true } ``` ```html <!-- Resulting HTML from test data one --> <p> Hi Ben! We think you might enjoy a map of trails in your area. You can find the map attached to this email. Have a great day. </p> <!-- Resulting HTML from test data two --> <p>Hi Ben! Have a great day.</p> <!-- Resulting HTML from test data three --> <p> Hi Ben! We think you might enjoy a map of trails in your area. You can find the map attached to this email. Have a great day. </p> ``` </code-group> ##### Or with else <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <p> Hello Ben! {{#or isRunner isCyclist}} We think you might enjoy a map of trails in your area. You can find the map attached to this email. {{else}} We'd love to know more about the outdoor activities you enjoy. The survey linked below will take only a minute to fill out. {{/or}}. Have a great day. </p> ``` ```json // Test data one { "isRunner": true, "isCyclist": false } // Test data two { "isRunner": false, "isCyclist": false } // Test data three { "isRunner": false, "isCyclist": true } ``` ```html <!-- Resulting HTML from test data one --> <p> Hi Ben! We think you might enjoy a map of trails in your area. You can find the map attached to this email. Have a great day. </p> <!-- Resulting HTML from test data two --> <p> Hi Ben! We'd love to know more about the outdoor activities you enjoy. The survey linked below will take only a minute to fill out. Have a great day. </p> <!-- Resulting HTML from test data three --> <p> Hi Ben! We think you might enjoy a map of trails in your area. You can find the map attached to this email. Have a great day. </p> ``` </code-group> #### Length The length helper will return the number of characters in a given string or array. For non-string and non-array values, length will return 0. Length can be useful in combination with other helpers as shown with greaterThan in the following example. <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Templates --> <p> Hello Ben! {{#greaterThan 0 length cartItems}} It looks like you still have some items in your shopping cart. Sign back in to continue checking out at any time. {{else}} Thanks for browsing our site. We hope you'll come back soon. {{/greaterThan}} </p> ``` ```json // Test data one { "cartItems": ["raft", "water bottle", "sleeping bag"] } // Test data two { "cartItems": [] } ``` ```html <!-- Resulting HTML with test data one--> <p> Hello Ben! It looks like you still have some items in your shopping cart. Sign back in to continue checking out at any time. </p> <!-- Resulting HTML with test data two--> <p>Hello Ben! Thanks for browsing our site. We hope you'll come back soon.</p> ``` </code-group> ### Iterations You can loop or iterate over data using the `{{#each }}` helper function to build lists and perform other useful templating actions. #### Basic Iterator with each <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> <ol> {{#each user.orderHistory}} <li>You ordered: {{this.item}} on: {{this.date}}</li> {{/each}} </ol> ``` ```json // Test data { "user": { "orderHistory": [ { "date": "2/1/2018", "item": "shoes" }, { "date": "1/4/2017", "item": "hat" } ] } } ``` ```html <!-- Resulting HTML --> <ol> <li>You ordered: shoes on: 2/1/2018</li> <li>You ordered: hat on: 1/42017</li> </ol> ``` </code-group> ### Combined examples The following examples show you how to combine multiple Handlebars functions to create a truly dynamic template. - [Dynamic content creation](#dynamic-content-creation) - [Dynamic content creation with dynamic parts 1](#dynamic-content-creation-with-dynamic-parts-1) - [Dynamic content creation with dynamic parts 2](#dynamic-content-creation-with-dynamic-parts-2) #### Dynamic content creation <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#each user.story}} {{#if this.male}} <p>{{this.date}}</p> {{else if this.female}} <p>{{this.item}}</p> {{/if}} {{/each}} ``` ```json // Test data { "user": { "story": [ { "male": true, "date": "2/1/2018", "item": "shoes" }, { "male": true, "date": "1/4/2017", "item": "hat" }, { "female": true, "date": "1/1/2016", "item": "shirt" } ] } } ``` ```html <!-- Resulting HTML --> <p>2/1/2018</p> <p>1/4/2017</p> <p>shirt</p> ``` </code-group> #### Dynamic content creation with dynamic parts 1 <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#each user.story}} {{#if this.male}} {{#if this.date}} <p>{{this.date}}</p> {{/if}} {{#if this.item}} <p>{{this.item}}</p> {{/if}} {{else if this.female}} {{#if this.date}} <p>{{this.date}}</p> {{/if}} {{#if this.item}} <p>{{this.item}}</p> {{/if}} {{/if}} {{/each}} ``` ```json // Test data { "user": { "story": [ { "male": true, "date": "2/1/2018", "item": "shoes" }, { "male": true, "date": "1/4/2017" }, { "female": true, "item": "shirt" } ] } } ``` ```html <!-- Resulting HTML --> <p>2/1/2018</p> <p>shoes</p> <p>1/4/2017</p> <p>shirt</p> ``` </code-group> #### Dynamic content creation with dynamic parts 2 <code-group langs="Handlebars, JSON, HTML"> ```handlebars <!-- Template --> {{#if people}} <p>People:</p> {{#each people}} <p>{{this.name}}</p> {{/each}} {{/if}} ``` ```json // Test data { "people": [{ "name": "Bob" }, { "name": "Sally" }] } ``` ```html <!-- Resulting HTML --> <p>People:</p> <p>Bob</p> <p>Sally</p> ``` </code-group> ## Additional Resources - [Sending Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Create and edit Dynamic Transactional Templates]({{root_url}}/ui/sending-email/create-and-edit-transactional-templates/) - [Dynamic Templates API](https://sendgrid.api-docs.io/v3.0/transactional-templates) - [How to send an email with dynamic templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) ================================================ FILE: content/docs/for-developers/sending-email/v2-csharp-code-example.md ================================================ --- layout: page weight: 0 title: v2 API C# Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using SendGrid C#, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-csharp), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in C#](https://github.com/sendgrid/sendgrid-csharp/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's C# Library ```csharp // using SendGrid's C# Library - https://github.com/sendgrid/sendgrid-csharp using System.Net.Http; using System.Net.Mail; var myMessage = new SendGrid.SendGridMessage(); myMessage.AddTo("test@sendgrid.com"); myMessage.From = new EmailAddress("you@youremail.com", "First Last"); myMessage.Subject = "Sending with SendGrid is Fun"; myMessage.PlainTextContent= "and easy to do anywhere, even with C#"; var transportWeb = new SendGrid.Web("SENDGRID_APIKEY"); transportWeb.DeliverAsync(myMessage); // NOTE: If you're developing a Console Application, // use the following so that the API call has time to complete // transportWeb.DeliverAsync(myMessage).Wait(); ``` ## Using .NET's Built-in SMTP Library If you choose not to use SendGrid's client library you may use .NET's built in library. If you are using ASP.NET, you can specify SMTP settings in web.config. Please note that your username should be "apikey" as specified in [Integrating with the SMTP API]({{root_url}}/for-developers/sending-email/integrating-with-the-smtp-api/). ```xml <system.net> <mailSettings> <smtp from="test@domain.com"> <network host="smtp.sendgrid.net" password="<your_api_key>" userName="apikey" port="587" /> </smtp> </mailSettings> </system.net> ``` This C# program will build a MIME email and send it through SendGrid. .NET already has built in libraries to send and receive emails. This example uses: [.NET Mail](http://msdn.microsoft.com/en-us/library/system.net.mail.aspx) ```csharp using System; using System.Collections.Generic; using System.Text; using System.Net.Mail; using System.Net.Mime; namespace SmtpMail { class Program { static void Main() { try { MailMessage mailMsg = new MailMessage(); // To mailMsg.To.Add(new MailAddress("to@example.com", "To Name")); // From mailMsg.From = new MailAddress("from@example.com", "From Name"); // Subject and multipart/alternative Body mailMsg.Subject = "subject"; string text = "text body"; string html = @"<p>html body</p>"; mailMsg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(text, null, MediaTypeNames.Text.Plain)); mailMsg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(html, null, MediaTypeNames.Text.Html)); // Init SmtpClient and send SmtpClient smtpClient = new SmtpClient("smtp.sendgrid.net", Convert.ToInt32(587)); System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("username@domain.com", "your_api_key"); smtpClient.Credentials = credentials; smtpClient.Send(mailMsg); } catch (Exception ex) { Console.WriteLine(ex.Message); } } } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-go-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Go Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using SendGrid Go, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-go), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in Go](https://github.com/sendgrid/sendgrid-go/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's Go Library ```go // using SendGrid's Go Library // https://github.com/sendgrid/sendgrid-go package main import ( "github.com/sendgrid/sendgrid-go" ) func main() { sg := sendgrid.NewSendGridClientWithApiKey("SENDGRID_APIKEY") message := sendgrid.NewMail() message.AddTo("test@sendgrid.com") message.SetFrom("you@youremail.com") message.SetSubject("Sending with SendGrid is Fun") message.SetHTML("and easy to do anywhere, even with Go") sg.Send(message) } ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-java-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Java Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using SendGrid Java, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-java), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in Java](https://github.com/sendgrid/sendgrid-java/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's Java Library ```java // using SendGrid's Java Library // https://github.com/sendgrid/sendgrid-java import com.sendgrid.*; public class SendGridExample { public static void main(String[] args) { SendGrid sendgrid = new SendGrid("SENDGRID_APIKEY"); SendGrid.Email email = new SendGrid.Email(); email.addTo("test@sendgrid.com"); email.setFrom("you@youremail.com"); email.setSubject("Sending with SendGrid is Fun"); email.setHtml("and easy to do anywhere, even with Java"); SendGrid.Response response = sendgrid.send(email); } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-nodejs-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Node.js Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using [v3]({{root_url}}/for-developers/sending-email/v3-nodejs-code-example/) SendGrid Node.js, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-nodejs), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in Node.js](https://github.com/sendgrid/sendgrid-nodejs/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's Node.js Library ```javascript // using SendGrid's Node.js Library // https://github.com/sendgrid/sendgrid-nodejs const sendgrid = require("sendgrid")("SENDGRID_APIKEY"); const email = new sendgrid.Email(); email.addTo("test@sendgrid.com"); email.setFrom("you@youremail.com"); email.setSubject("Sending an email with SendGrid is Fun"); email.setHtml("and easy to do anywhere, even with Node.js"); sendgrid.send(email); ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-perl-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Perl Code Example group: api-v2 seo: title: Send Email with Perl and SendGrid description: View code examples showing how to easily send email with Perl using SMTP and SendGrid. Further explore SendGrid's email sending Perl library. navigation: show: true --- <call-out> We recommend using SendGrid Perl, our client library, <a href="https://github.com/sendgrid/sendgrid-perl">available on GitHub</a>, with full documentation. </call-out> ## Using SendGrid's Perl Library ```perl # Using SendGrid's Perl Library # https://github.com/sendgrid/sendgrid-perl use Mail::SendGrid; use Mail::SendGrid::Transport::REST; my $sendgrid = Mail::SendGrid->new( from => "test@sendgrid.com", to => "example@example.com", subject => "Sending with SendGrid is Fun", html => "and easy to do anywhere, even with Perl" ); Mail::SendGrid::Transport::REST->new( username => $api_user, api_key => $api_key ); ``` ## Without sendgrid-perl If you choose not to use SendGrid's client library you may use Perl's generic SMTP library. The following code builds a MIME mail message demonstrating all the portions of the SMTP API protocol. To use this example, you will need to have the following perl modules installed: * [MIME::Entity](http://search.cpan.org/perldoc?MIME::Entity) * [Authen::SASL](http://search.cpan.org/perldoc?Authen::SASL) ```perl #!/usr/bin/perl use strict; use MIME::Entity; use Net::SMTP; # from is your email address # to is who you are sending your email to # subject will be the subject line of your email my $from = 'you@yourdomain.com'; my $to = 'example@example.com'; my $subject = 'Example Perl Email'; # Create the MIME message that will be sent. Check out MIME::Entity on CPAN for more details my $mime = MIME::Entity->build(Type => 'multipart/alternative', Encoding => '-SUGGEST', From => $from, To => $to, Subject => $subject ); # Create the body of the message (a plain-text and an HTML version). # text is your plain-text email # html is your html version of the email # if the receiver is able to view html emails then only the html # email will be displayed my $text = "Hi!\nHow are you?\n"; my $html = <<EOM; <html> <head></head> <body> <p>Hi!<br> How are you?<br> </p> </body> </html> EOM # attach the body of the email $mime->attach(Type => 'text/plain', Encoding =>'-SUGGEST', Data => $text); $mime->attach(Type => 'text/html', Encoding =>'-SUGGEST', Data => $html); # attach a file my $my_file_txt = 'example.txt'; $mime->attach ( Path => $my_file_txt, Type => 'text/txt', Encoding => 'base64' ) or die "Error adding !\n"; # Login credentials my $username = 'example@example.com'; my $api_key = "your_api_key"; # Open a connection to the SendGrid mail server my $smtp = Net::SMTP->new('smtp.sendgrid.net', Port=> 587, Timeout => 20, Hello => "yourdomain.com"); # Authenticate $smtp->auth($username, $api_key); # Send the rest of the SMTP stuff to the server $smtp->mail($from); $smtp->to($to); $smtp->data($mime->stringify); $smtp->quit(); ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-php-code-example.md ================================================ --- layout: page weight: 0 title: v2 API PHP Code Example group: api-v2 seo: override: true title: Send Email with PHP and SendGrid - SendGrid Documentation | SendGrid description: View code examples showing how to easily send email with PHP using cURL and SendGrid. Further explore SendGrid's email sending PHP library. navigation: show: true --- <call-out> We recommend using SendGrid PHP, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-php), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in PHP](https://github.com/sendgrid/sendgrid-php/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's PHP Library ```php // using SendGrid's PHP Library // https://github.com/sendgrid/sendgrid-php require 'vendor/autoload.php'; $sendgrid = new SendGrid("SENDGRID_APIKEY"); $email = new SendGrid\Email(); $email->addTo("test@sendgrid.com") ->setFrom("you@youremail.com") ->setSubject("Sending with SendGrid is Fun") ->setHtml("and easy to do anywhere, even with PHP"); $sendgrid->send($email); ``` ## Using PHP with cURL If you choose not to use SendGrid's client library you may use PHP's cURL function to query the web API. ```php <?php require 'vendor/autoload.php'; Dotenv::load(__DIR__); $sendgrid_apikey = getenv('YOUR_SENDGRID_APIKEY'); $sendgrid = new SendGrid($sendgrid_apikey); $url = 'https://api.sendgrid.com/'; $pass = $sendgrid_apikey; $template_id = '<your_template_id>'; $js = array( 'sub' => array(':name' => array('Elmer')), 'filters' => array('templates' => array('settings' => array('enable' => 1, 'template_id' => $template_id))) ); $params = array( 'to' => "test@example.com", 'toname' => "Example User", 'from' => "you@youremail.com", 'fromname' => "Your Name", 'subject' => "PHP Test", 'text' => "I'm text!", 'html' => "<strong>I'm HTML!</strong>", 'x-smtpapi' => json_encode($js), ); $request = $url.'api/mail.send.json'; // Generate curl request $session = curl_init($request); // Tell PHP not to use SSLv3 (instead opting for TLS) curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($session, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $sendgrid_apikey)); // Tell curl to use HTTP POST curl_setopt ($session, CURLOPT_POST, true); // Tell curl that this is the body of the POST curl_setopt ($session, CURLOPT_POSTFIELDS, $params); // Tell curl not to return headers, but do return the response curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // obtain response $response = curl_exec($session); curl_close($session); // print everything out print_r($response); ?> ``` ## An Email Sent Using the SMTPAPI Header This example takes the previous example a step further by adding our SMTPAPI header to set a category and send out to multiple recipients. The category is called test_category, and the email will go out to both example1@sendgrid.com and example2@sendgrid.com. The normal to address, example3@sendgrid.com, will not receive an email. ```php <?php $url = 'https://api.sendgrid.com/'; $user = 'USERNAME'; $pass = 'APIKEY'; $json_string = array( 'to' => array( 'example1@sendgrid.com', 'example2@sendgrid.com' ), 'category' => 'test_category' ); $params = array( 'api_user' => $user, 'api_key' => $pass, 'x-smtpapi' => json_encode($json_string), 'to' => 'example3@sendgrid.com', 'subject' => 'testing from curl', 'html' => 'testing body', 'text' => 'testing body', 'from' => 'example@sendgrid.com', ); $request = $url.'api/mail.send.json'; // Generate curl request $session = curl_init($request); // Tell curl to use HTTP POST curl_setopt ($session, CURLOPT_POST, true); // Tell curl that this is the body of the POST curl_setopt ($session, CURLOPT_POSTFIELDS, $params); // Tell curl not to return headers, but do return the response curl_setopt($session, CURLOPT_HEADER, false); // Tell PHP not to use SSLv3 (instead opting for TLS) curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // obtain response $response = curl_exec($session); curl_close($session); // print everything out print_r($response); ?> ``` ## An Email Sent Including a File Attachment This example adds the additional attachment parameter to attach a file called myfile. This example assumes the file is in the same directory as your code otherwise you need to specify the full path of the file in the \$filePath variable. ```php <?php $url = 'https://api.sendgrid.com/'; $user = 'USERNAME'; $pass = 'PASSWORD'; $fileName = 'myfile'; $filePath = dirname(__FILE__); $params = array( 'api_user' => $user, 'api_key' => $pass, 'to' => 'example@sendgrid.com', 'subject' => 'test of file sends', 'html' => '<p> the HTML </p>', 'text' => 'the plain text', 'from' => 'example@sendgrid.com', 'files['.$fileName.']' => '@'.$filePath.'/'.$fileName ); print_r($params); $request = $url.'api/mail.send.json'; // Generate curl request $session = curl_init($request); // Tell curl to use HTTP POST curl_setopt ($session, CURLOPT_POST, true); // Tell curl that this is the body of the POST curl_setopt ($session, CURLOPT_POSTFIELDS, $params); // Tell curl not to return headers, but do return the response curl_setopt($session, CURLOPT_HEADER, false); // Tell PHP not to use SSLv3 (instead opting for TLS) curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // obtain response $response = curl_exec($session); curl_close($session); // print everything out print_r($response); ?> ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-python-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Python Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using SendGrid Python, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-python), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in Python](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's Python Library ```python # using SendGrid's Python Library # https://github.com/sendgrid/sendgrid-python import sendgrid client = sendgrid.SendGridClient("SENDGRID_APIKEY") message = sendgrid.Mail() message.add_to("test@sendgrid.com") message.set_from("you@youremail.com") message.set_subject("Sending with SendGrid is Fun") message.set_html("and easy to do anywhere, even with Python") client.send(message) ``` ================================================ FILE: content/docs/for-developers/sending-email/v2-ruby-code-example.md ================================================ --- layout: page weight: 0 title: v2 API Ruby Code Example group: api-v2 navigation: show: true --- <call-out> We recommend using SendGrid Ruby, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-ruby), with full documentation. </call-out> <call-out> The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see [Continue Using V2 in Ruby](https://github.com/sendgrid/sendgrid-ruby/blob/master/TROUBLESHOOTING.md#v2). </call-out> ## Using SendGrid's Ruby Library ```ruby # using SendGrid's Ruby Library # https://github.com/sendgrid/sendgrid-ruby require 'sendgrid-ruby' sendgrid = SendGrid::Client.new do |c| c.api_key = 'SENDGRID_APIKEY' end email = SendGrid::Mail.new do |m| m.to = 'test@sendgrid.com' m.from = 'you@youremail.com' m.subject = 'Sending with SendGrid is Fun' m.html = 'and easy to do anywhere, even with Ruby' end sendgrid.send(email) ``` This example shows how to send email plain text and HTML email using Ruby. The gem [Mail](https://github.com/mikel/mail) is required. ```ruby require 'mail' Mail.defaults do delivery_method :smtp, { :address => "smtp.sendgrid.net", :port => 587, :domain => "yourdomain.com", :user_name => "yourusername@domain.com", :api_key => "your_api_key", :authentication => 'plain', :enable_starttls_auto => true } end mail = Mail.deliver do to 'yourRecipient@domain.com' from 'Your Name <name@domain.com>' subject 'This is the subject of your email' text_part do body 'Hello world in text' end html_part do content_type 'text/html; charset=UTF-8' body '<b>Hello world in HTML</b>' end end ``` To install the [Mail](https://github.com/mikel/mail) gem please note that you need the OpenSSL library installed, then run the following: ```bash gem install mail ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-csharp-code-example.md ================================================ --- layout: page weight: 0 title: v3 API C# Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid C#, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-csharp), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's C# Library ```csharp // using SendGrid's C# Library // https://github.com/sendgrid/sendgrid-csharp using SendGrid; using SendGrid.Helpers.Mail; using System; using System.Threading.Tasks; namespace Example { internal class Example { private static void Main() { Execute().Wait(); } static async Task Execute() { var apiKey = Environment.GetEnvironmentVariable("NAME_OF_THE_ENVIRONMENT_VARIABLE_FOR_YOUR_SENDGRID_KEY"); var client = new SendGridClient(apiKey); var from = new EmailAddress("test@example.com", "Example User"); var subject = "Sending with SendGrid is Fun"; var to = new EmailAddress("test@example.com", "Example User"); var plainTextContent = "and easy to do anywhere, even with C#"; var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>"; var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent); var response = await client.SendEmailAsync(msg); } } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-go-code-example.md ================================================ --- layout: page weight: 0 title: v3 API Go Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid Go, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-go), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's Go Library ```go // using SendGrid's Go Library // https://github.com/sendgrid/sendgrid-go package main import ( "fmt" "log" "os" "github.com/sendgrid/sendgrid-go" "github.com/sendgrid/sendgrid-go/helpers/mail" ) func main() { from := mail.NewEmail("Example User", "test@example.com") subject := "Sending with SendGrid is Fun" to := mail.NewEmail("Example User", "test@example.com") plainTextContent := "and easy to do anywhere, even with Go" htmlContent := "<strong>and easy to do anywhere, even with Go</strong>" message := mail.NewSingleEmail(from, subject, to, plainTextContent, htmlContent) client := sendgrid.NewSendClient(os.Getenv("SENDGRID_API_KEY")) response, err := client.Send(message) if err != nil { log.Println(err) } else { fmt.Println(response.StatusCode) fmt.Println(response.Body) fmt.Println(response.Headers) } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-java-code-example.md ================================================ --- layout: page weight: 0 title: v3 API Java Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid Java, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-java), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's Java Library ```java // using SendGrid's Java Library // https://github.com/sendgrid/sendgrid-java import com.sendgrid.*; import java.io.IOException; public class Example { public static void main(String[] args) throws IOException { Email from = new Email("test@example.com"); String subject = "Sending with SendGrid is Fun"; Email to = new Email("test@example.com"); Content content = new Content("text/plain", "and easy to do anywhere, even with Java"); Mail mail = new Mail(from, subject, to, content); SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY")); Request request = new Request(); try { request.setMethod(Method.POST); request.setEndpoint("mail/send"); request.setBody(mail.build()); Response response = sg.api(request); System.out.println(response.getStatusCode()); System.out.println(response.getBody()); System.out.println(response.getHeaders()); } catch (IOException ex) { throw ex; } } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-kotlin-code-example.md ================================================ --- layout: page weight: 0 title: v3 API Kotlin Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid Java, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-java), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's Java Library ```kotlin // using SendGrid's Java Library // https://github.com/sendgrid/sendgrid-java import com.sendgrid.*; import java.io.IOException; class Example { private fun sendEmail() { val sendgrid = SendGrid("SENDGRID_APIKEY") val email = SendGrid.Email() email.addTo("test@sendgrid.com") email.setFrom("you@youremail.com") email.setSubject("Sending with SendGrid is Fun") email.setHtml("and easy to do anywhere, even with Kotlin") val response = sendgrid.send(email) } } ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-mail-send-faq.md ================================================ --- seo: title: v3 Mail Send FAQ description: keywords: v2 mail send, v3 mail send, faq, frequently asked questions title: v3 Mail Send FAQ group: api-v3 weight: 0 layout: page navigation: show: true --- ## What is the v3 Mail Send endpoint? The [v3 Mail Send endpoint](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) is the latest version of SendGrid’s Web API endpoint that allows you to send email by making a simple HTTP request. The introduction of the v3 Mail Send endpoint signifies the completion of our RESTful Web API v3. If you’re looking for one of the other methods that you can use to send mail through SendGrid, please see our [SMTP]({{root_url}}/for-developers/sending-email/getting-started-smtp/), [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) feature, or [Web API v2](https://www.twilio.com/docs/sendgrid/api/v2/mail). ## Do I have to have a certain type of account to use the v3 Mail Send endpoint? The v3 Mail Send endpoint is available on all SendGrid pricing plans. The same plan based limitations on the volume of email you may send still apply to the v3 Mail Send endpoint. For more information, please visit our [Pricing Page](https://sendgrid.com/pricing). ## I’m currently using the v2 Mail Send endpoint. Should I switch to v3? The v3 Mail Send endpoint offers many improvements over the v2 endpoint, and we highly encourage all users to migrate their email programs from the v2 to the v3 endpoint. While you may not notice any significant changes in the functionality offered by the v3 mail send endpoint, you will find it to be significantly easier to use. The v3 Mail Send endpoint offers a more comprehensive and consistent [JSON schema](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-requests#making-a-request), intuitive validation with more in depth [error messages](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-errors#response-codes), and complete coverage across all [7 of our supported libraries]({{root_url}}/for-developers/sending-email/libraries/). ## How do I migrate from V2 to V3? If you are currently using the v2 Mail Send endpoint, we have provided some [helpful instructions]({{root_url}}/for-developers/sending-email/migrating-from-v2-to-v3-mail-send/) on how to migrate from sending mail over the Web API v2 to the Web API v3. ## What’s the difference between sending mail via SMTP and the Web API? Sending email via the [SMTP-Relay]({{root_url}}/for-developers/sending-email/getting-started-smtp/) is a quick and simple way to integrate your existing SMTP code with SendGrid’s email functionality. All you have to do is modify your SMTP configuration to point to SendGrid’s SMTP server and your email will be routed through SendGrid’s SMTP-Relay. You may then specify special instructions for how you would like SendGrid to handle your email by means of the [X-SMTPAPI header]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/). The Web API, on the other hand, requires you to make an HTTP request to an endpoint in SendGrid’s API. Previously, SendGrid has only offered an email sending endpoint in the Web API v2, but now you can use the RESTful Web API v3 to send your email. Simply make an `HTTP POST` request to `https://api.sendgrid.com/v3/mail/send` with the data for your email included in a JSON payload. For more information, please visit our [v3 Mail Send documentation](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). ## Can I send marketing email over the v3 Mail Send endpoint? You can send any type of email (transactional or marketing) over the v3 Mail Send endpoint. However, we recommend you take a look at our [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) for a more robust marketing feature set (including segmentation and templates). ## Are there limits on how often I can send email and how many recipients I can send to? There are rate limits on how frequently you can call the v3 Mail Send endpoint. Currently, you may make up to 10,000 requests per second to our endpoint. Each email you send may include up to 1000 recipients. For more information on other limitations, and how this may impact your integration, please visit our [v3 Mail Send overview](https://sendgrid.api-docs.io/v3.0/how-to-use-the-sendgrid-v3-api/api-rate-limits). ## Why did you remove the x-smtpapi parameter? Can I still change my mail settings, tracking settings, and unique arguments? Everything that could be accomplished by using the x-smtpapi parameter in the v2 Mail Send endpoint can still be done with the v3 endpoint. While the v2 Mail Send endpoint required you to include a separate block of JSON for various mail settings within the single x-smtpapi parameter, the v3 endpoint payload structure includes each setting as a separate parameter. This allows for a quicker and more consistent integration and helps with validation and debugging. ## Where can I find more information about the v3 Mail Send endpoint? For more general information about the v3 Mail Send endpoint, please visit the [v3 Mail Send Overview]({{root_url}}/api-reference). Below, you will find links to more in depth information about the endpoint. ## Additional Resources - [v3 Mail Send Overview](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) - [SandBox Mode]({{root_url}}/for-developers/sending-email/sandbox-mode/) - [Errors](https://sendgrid.api-docs.io/v3.0/mail-send/mail-send-errors) - [Personalizations]({{root_url}}/for-developers/sending-email/personalizations/) - [Examples for Common Use Cases]({{root_url}}/for-developers/sending-email/curl-examples/) - [How to Migrate from V2 to V3 Mail Send]({{root_url}}/for-developers/sending-email/migrating-from-v2-to-v3-mail-send/) ================================================ FILE: content/docs/for-developers/sending-email/v3-php-code-example.md ================================================ --- layout: page weight: 0 title: v3 API PHP Code Example group: api-v3 seo: override: true title: Send Email with PHP and Twilio SendGrid - Twilio SendGrid Documentation | Twilio SendGrid description: View code examples showing how to easily send email with PHP using cURL and Twilio SendGrid. Further explore Twilio SendGrid's email sending PHP library. navigation: show: true --- <call-out> We recommend using Twilio SendGrid PHP, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-php), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! Make sure you've set the [SENDGRID_API_KEY](https://github.com/sendgrid/sendgrid-php#setup-environment-variables) environment variable in your env file. </call-out> ## Using Twilio SendGrid's PHP Library Please see the [Twilio SendGrid PHP example code at GitHub](https://github.com/sendgrid/sendgrid-php/blob/main/USE_CASES.md#send-an-email-to-a-single-recipient). ================================================ FILE: content/docs/for-developers/sending-email/v3-python-code-example.md ================================================ --- layout: page weight: 0 title: v3 API Python Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid Python, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-python), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's Python Library ```python # using SendGrid's Python Library # https://github.com/sendgrid/sendgrid-python import os from sendgrid import SendGridAPIClient from sendgrid.helpers.mail import Mail message = Mail( from_email='from_email@example.com', to_emails='to@example.com', subject='Sending with Twilio SendGrid is Fun', html_content='<strong>and easy to do anywhere, even with Python</strong>') try: sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY')) response = sg.send(message) print(response.status_code) print(response.body) print(response.headers) except Exception as e: print(e.message) ``` ================================================ FILE: content/docs/for-developers/sending-email/v3-ruby-code-example.md ================================================ --- layout: page weight: 0 title: v3 API Ruby Code Example group: api-v3 navigation: show: true --- <call-out> We recommend using SendGrid Ruby, our client library, [available on GitHub](https://github.com/sendgrid/sendgrid-ruby), with full documentation. </call-out> <call-out> Do you have an [API Key](https://app.sendgrid.com/settings/api_keys) yet? If not, go get one. You're going to need it to integrate! </call-out> ## Using SendGrid's Ruby Library ```ruby # using SendGrid's Ruby Library # https://github.com/sendgrid/sendgrid-ruby require 'sendgrid-ruby' include SendGrid from = SendGrid::Email.new(email: 'test@example.com') to = SendGrid::Email.new(email: 'test@example.com') subject = 'Sending with SendGrid is Fun' content = SendGrid::Content.new(type: 'text/plain', value: 'and easy to do anywhere, even with Ruby') mail = SendGrid::Mail.new(from, subject, to, content) sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) response = sg.client.mail._('send').post(request_body: mail.to_json) puts response.status_code puts response.body puts response.headers ``` ================================================ FILE: content/docs/for-developers/sending-email/wordpress-faq.md ================================================ --- seo: title: Wordpress FAQ description: Learn how to send your WordPress email through SendGrid. keywords: WordPress, SendGrid, integrate, plugin, subscription widget title: Wordpress FAQ group: plugins weight: 100 layout: page navigation: show: true --- ## What PHP versions are supported? Plugin versions 1.11.x were tested and confirmed to work on PHP 5.4, 5.5, 5.6, 7.0, 7.1. It DOES NOT work on PHP 5.3 and earlier. Plugin versions 1.10.x were tested and confirmed to work on PHP 5.3, 5.4, 5.5 and 5.6. It DOES NOT work on PHP 7.0 and later. ## What credentials do I need to add on the settings page? If you do not already have one, simply [create a SendGrid account](https://sendgrid.com/partner/wordpress) and [generate a new API Key](https://app.sendgrid.com/settings/api_keys). ## How can I define a plugin setting to be used for all sites? To define a plugin setting that you want to use on all of your WordPress sites, simply add it into your wp-config.php file. For example, the following API Key setting would be applicable across each of your WordPress sites: ```php define('SENDGRID_API_KEY', 'your_api_key'); ``` ## How do I use SendGrid with the WP Better Emails plugin? If you have the [WP Better Emails plugin](https://wordpress.org/plugins/wp-better-emails/) installed and you want to use the template defined here instead of the SendGrid template, you can add the following code in your functions.php file from your theme: ```php function use_wpbe_template( $message, $content_type ) { global $wp_better_emails; if ( 'text/plain' == $content_type ) { $message = $wp_better_emails->process_email_text( $message ); } else { $message = $wp_better_emails->process_email_html( $message ); } return $message; } add_filter( 'sendgrid_override_template', 'use_wpbe_template', 10, 2 ); ``` Using the default templates from WP Better Emails will cause all emails to be sent as HTML (i.e. content-type of text/html). In order to send emails as plain text (i.e. a content-type of text/plain) you should remove the HTML Template from WP Better Emails settings page. This is can be done by removing the `%content%` tag from the HTML template. ## Why are my emails sent as HTML instead of plain text? For a detailed explanation of why your emails might be converted to HTML instead of plain text, please see [Cross-platform Email Design]({{root_url}}/ui/sending-email/cross-platform-html-design/). ## Will contacts from the widget be uploaded to Marketing Campaigns or Legacy Newsletter? The contacts will only be uploaded to Marketing Campaigns. ## What permissions should my API keys have? For the API Key used for sending emails (the General tab): * Full Access to Mail Send. * Read Access to Stats. * Read Access to Suppressions > Unsubscribe Groups. * Read Access to Template Engine. For the API Key used for contact upload (the Subscription Widget tab): * Full Access to Marketing Campaigns. ## Can I disable the opt-in email? No. SendGrid’s Email Policy requires that all email addresses sent to by SendGrid customers be confirmed via an opt-in email. In other words, every recipient of an email sent via SendGrid must actively confirm their desire to receive that email by means of an opt-in confirmation. ## Can I change the content of the emails before they are sent? Yes, you can change the content by adding a filter. You need to declare a function that takes the content of the email as an argument and then call `add_filter()` with the name "sendgrid_mail_text" or "sendgrid_mail_html", depending on what part of the email you want to change. If you want to change the _text content_ of all emails before they are delivered, add the following to the functions.php file of your WordPress installation. ```php function change_sendgrid_text_email( $message ) { return $message . ' changed by way of text filter '; } add_filter( 'sendgrid_mail_text', 'change_sendgrid_text_email' ); ``` If you want to change the _HTML content_ of all emails before they are delivered, simply add the following to the **functions.php** file of your WordPress installation. ```php function change_sendgrid_html_email( $message ) { return $message . ' changed by way of html filter '; } add_filter( 'sendgrid_mail_html', 'change_sendgrid_html_email' ); ``` <call-out> **Please note:** What is changed in your emails depends on the content-type that you have set in the settings page or overwritten in a filter. For "text/plain," only the text part is overwritten by the filter. For "text/html," both the text and the HTML filters are called. </call-out> The code snippets above are usually added in the functions.php file of your theme. ## Can the SendGrid Plugin be used on a multisite network? Yes. This plugin has basic multisite network support. To use the SendGrid plugin on your multisite network, navigate to your WordPress dashboard and click **My Sites**, select **Network Admin**, and click on **Plugins**. Under the SendGrid WordPress plugin, click **Network Enable**. The settings for all sites in the network can only be configured by the network admin in the Network Admin dashboard. <call-out> **Please note:** Since 1.10.5 the Network Admin can delegate the configuration for each subsite to their respective owners. This will allow any subsite to use it’s own SendGrid Plugin configuration. </call-out> ## Can I use shortcodes to customize the subscription confirmation page? Yes. You need to create custom page and select it from the settings page. You can place any of these shortcodes in the body of that page. Here’s an example : ```php Hi [sendgridSubscriptionFirstName] [sendgridSubscriptionLastName], Your email address : [sendgridSubscriptionEmail] has been successfully added. You'll hear from us soon! ``` You need to enable the use of the First Name and Last Name fields from the settings page in order to use the shortcodes for them. ## Can I use this plugin with BuddyPress? Yes. Our plugin required special integration with BuddyPress and it’s regularly tested to ensure it behaves as expected. If you have noticed issues caused by installing this plugin along with BuddyPress, you can add the following line to your `wp-config.php` to disable it : ```php define('SENDGRID_DISABLE_BUDDYPRESS', '1'); ``` ## Related Content * [SendGrid’s WordPress Plugin]({{root_url}}/for-developers/sending-email/wordpress-plugin/) * [SendGrid’s WordPress Subscription Widget]({{root_url}}/for-developers/sending-email/wordpress-subscription-widget/) ================================================ FILE: content/docs/for-developers/sending-email/wordpress-plugin.md ================================================ --- st: published_at: 2016-07-25 type: [integrate] seo: title: SendGrid's WordPress Plugin description: Learn how to send your WordPress email through SendGrid. keywords: WordPress, SendGrid, integrate, plugin, subscription widget title: SendGrid's WordPress Plugin group: plugins weight: 100 layout: page navigation: show: true --- SendGrid's cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. SendGrid provides reliable deliverability, scalability, and real-time analytics along with flexible APIs that make custom integration with your application a breeze. SendGrid’s [WordPress plugin](https://wordpress.org/plugins/sendgrid-email-delivery-simplified/) replaces WordPress’s default **wp_mail()** function by using either an SMTP or API integration with SendGrid to send outgoing email from your WordPress installation. It also allows you to upload contacts directly to your SendGrid Marketing Campaigns account via a [subscription widget]({{root_url}}/for-developers/sending-email/wordpress-subscription-widget/). By using the SendGrid plugin, you will be able to take advantage of improved deliverability and an expanded feature set, including tracking and analytics, to enhance user engagement on your WordPress installation. SendGrid also provides world class customer support, should you run into any issues. ## Installing SendGrid’s WordPress Plugin In order to send emails through SMTP, you first need to install the [Swift Mailer](https://wordpress.org/plugins/swift-mailer/) plugin. To get the SendGrid plugin running after you have activated Swift Mailer, navigate to Settings and enter your SendGrid credentials. Finally, select how you want your email to be delivered: either via SMTP or API. You can also set default values for the "Name," "Sending Address," and the "Reply Address” headers so that you don’t have to define these headers every time you want to send an email. If you would like to use [templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/), you can set the template ID to be used in all of your emails on the settings page or you can set it individually for each email in the headers. You can have an individual email sent to each recipient by specifying the x-smtpapi-to header. For example: ```php x-smtpapi-to: example@example.com, example2@example.com ``` <call-out> When using the SMTP method you must also define the `To` address. It does not matter what address you set in the `To` field since it will be overwritten by `x-smtpapi-to`. </call-out> Emails are automatically tracked, allowing you to retrieve delivery and engagement statistics from within the SendGrid Dashboard. You can also specify certain [categories](#how-to-use-categories) for any of your emails to help you organize them by type. ## Configuring SendGrid’s WordPress Plugin While it is possible to simply install and configure the SendGrid plugin for WordPress as described above to immediately begin sending your emails through SendGrid, you may take steps to further customize the SendGrid WordPress plugin. The following explanations and examples show how you can use SendGrid to adjust WordPress’s `wp_mail()` function. ##### The wp_mail() Function The SendGrid plugin makes adjustments to the `wp_mail()` function so that all emails sent from WordPress are delivered by SendGrid. You can send emails using the following function: ```php wp_mail($to, $subject, $message, $headers ="", $attachments = array()) ``` <table class="table"> <tr><th>Variable</th><th>Description</th></tr> <tr><td><code>$to</code></td><td>An array, or comma-separated list (CSV), of email addresses to send message.</td></tr> <tr><td><code>$subject</code></td><td>The subject of your email.</td></tr> <tr><td><code>$message</code></td><td>The contents of your email.</td></tr> <tr><td><code>$headers</code></td><td>An optional array or SendGrid\Email() object.</td></tr> <tr><td><code>$attachments</code></td><td>An optional array, a comma separated list (", "), or a new line separated list ("\n") of files to attach.</td></tr> </table> If you want to send an email with HTML content, set the content type to 'text/html' by running the following function before `wp_mail()`: ```php add_filter('wp_mail_content_type', 'set_html_content_type'); ``` <call-out type="warning"> After you’ve run wp_mail(), you must remove the ‘text/html’ filter in order to return to your initial settings. </call-out> ```php remove_filter('wp_mail_content_type', 'set_html_content_type'); ``` ## Sending HTML in Your Email Using Different Headers <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> #### Using an Array to Set Your Headers ```php $subject = 'Test SendGrid plugin'; $message = 'testing WordPress plugin'; $to = array('address1@sendgrid.com', 'Address2 <address2@sendgrid.com>', 'address3@sendgrid.com'); $headers = array(); $headers[] = 'From: Me Myself <me@example.net>'; $headers[] = 'Cc: address4@sendgrid.com'; $headers[] = 'Bcc: address5@sendgrid.com'; $headers[] = 'unique-args:customer=mycustomer;location=mylocation'; $headers[] = 'categories: category1, category2'; $headers[] = 'template: templateID'; $headers[] = 'x-smtpapi-to: address1@sendgrid.com,address2@sendgrid.com'; $attachments = array('/tmp/img1.jpg', '/tmp/img2.jpg'); add_filter('wp_mail_content_type', 'set_html_content_type'); $mail = wp_mail($to, $subject, $message, $headers, $attachments); remove_filter('wp_mail_content_type', 'set_html_content_type'); ``` #### Using SendGrid\Email() to Set Your Headers ```php $subject = 'Test SendGrid plugin'; $message = 'testing WordPress plugin'; $to = array('address1@sendgrid.com', 'Address2 <address2@sendgrid.com>', 'address3@sendgrid.com'); $headers = new SendGrid\Email(); $headers->setFromName("John Doe") ->setFrom("example@example.net") ->setCc("example2@example.com") ->setBcc("example3@example.com") ->setUniqueArgs(array('customer' => 'mycustomer', 'location' => 'mylocation')) ->addCategory('category1') ->addCategory('category2') ->setTemplateId('templateID'); $attachments = array('/tmp/img1.jpg', '/tmp/img2.jpg'); add_filter('wp_mail_content_type', 'set_html_content_type'); $mail = wp_mail($to, $subject, $message, $headers, $attachments); remove_filter('wp_mail_content_type', 'set_html_content_type'); ``` ## Substitution Tags and Sections ```php $subject = 'Hey %name%, you work at %place%'; $message = 'testing WordPress plugin'; $to = array('address1@sendgrid.com'); $headers = new SendGrid\Email(); $headers ->addSmtpapiTo("john@somewhere.com") ->addSmtpapiTo("harry@somewhere.com") ->addSmtpapiTo("Bob@somewhere.com") ->addSubstitution("%name%", array("John", "Harry", "Bob")) ->addSubstitution("%place%", array("%office%", "%office%", "%home%")) ->addSection("%office%", "an office") ->addSection("%home%", "your house"); $mail = wp_mail($to, $subject, $message, $headers); ``` For more examples of how you can use SendGrid SMTPAPI headers, please visit the [SendGrid PHP Library on GitHub](https://github.com/sendgrid/sendgrid-php#smtpapi). ## How to Use Categories <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> You can use [categories]({{root_url}}/ui/analytics-and-reporting/categories/) to help organize and track the emails sent from WordPress via the SendGrid plugin. Categories used for emails can be set either globally, or on an email-by-email basis. To set categories globally, thus applying a category to every email sent, simply define the value for the 'Categories' field in the 'Mail settings' section You can also assign a specific category to an email by using the headers array. Use the following format when assigning specific categories to an email: ```php $headers[] = 'categories: category1, category2'; ``` If you would like to configure categories for statistics tracking, simply set your desired category as the value of the 'Categories' field in the 'Statistics settings' section. ## Multisite If you are using the SendGrid plugin in a multisite environment, you need to enable it for use across your multisite network. Simply navigate to **My Sites**, click on **Network Admin**, and select **Plugins**. Here you can either enable or disable your SendGrid plugin for use across your multisite network. Once you have enabled SendGrid for use across your multisite network, you will be able to access the settings page from the network dashboard. You can enable access for SendGrid settings to each subsite in the Multisite Settings tab. If the checkbox is unchecked then that site will not see the SendGrid settings page and it will use the settings set on the network. <call-out> **Please note!** When you activate SendGrid management for a subsite, that site will not be able to send emails until the admin updates the SendGrid settings on that subsite. </call-out> If you have already installed the SendGrid plugin in a multisite environment and you update to any version **after** 1.9.0 you may need to re-configure your plugin. ## Additional Resources - [SendGrid's WordPress Subscription Widget]({{root_url}}/for-developers/sending-email/wordpress-subscription-widget/) - [SendGrid's WordPress Integration FAQ]({{root_url}}/for-developers/sending-email/wordpress-faq/) ================================================ FILE: content/docs/for-developers/sending-email/wordpress-subscription-widget.md ================================================ --- st: published_at: 2016-07-25 type: [integrate] seo: title: WordPress Subscription Widget description: Learn how to send your WordPress email through SendGrid. keywords: WordPress, SendGrid, integrate, plugin, subscription widget title: WordPress Subscription Widget group: plugins weight: 100 layout: page navigation: show: true --- ## What is the Subscription Widget SendGrid’s WordPress Subscription Widget makes it easy for people visiting your WordPress site to subscribe to your marketing emails, such as any newsletters, announcements, or promotional offers you may send. Upon signup, they’ll automatically receive an opt-in email allowing them to confirm their desire to begin receiving your emails. This confirmation constitutes “double opt-in,” a deliverability best practice. ## Installing the Subscription Widget ### Requirements - PHP version >= 5.6 and <= 7.1. Installing this plugin on PHP versions 5.3 and earlier will cause your website to break. Installation on PHP versions 5.4 and 5.5 will work but it is not recommended. - To send emails through SMTP you need to install the [Swift Mailer plugin](https://wordpress.org/plugins/swift-mailer/). - If the `wp_mail()` function has been declared by another plugin that you have installed, you won't be able to use the SendGrid plugin. ### Automatically Install the SendGrid Plugin from the WordPress Admin Page 1. After logging into your WordPress account, navigate to **Plugins** and click **Add New**. 2. Search for "SendGrid Plugin" and click **Install Now** 3. Activate the plugin from the **Plugins** menu in WordPress or from the plugin installation screen. 4. [Create a SendGrid account](http://sendgrid.com/partner/wordpress) on the WordPress Partner's Page 5. Navigate to **Settings**, select **SendGrid Settings**, and enter your SendGrid credentials. ### Manually Install the SendGrid Plugin by Uploading the SendGrid Plugin ZIP File 1. Upload the WordPress SendGrid Plugin to the **/wp-contents/plugins/** folder. 2. Activate the plugin from the **Plugins** menu in WordPress. 3. [Create a SendGrid account](http://sendgrid.com/partner/wordpress) on the WordPress Partner's Page 4. Navigate to **Settings**, select **SendGrid Settings**, and enter your SendGrid credentials. ## Configuring the SendGrid Subscription Widget in WordPress To set up the subscription widget from the WordPress interface, open the SendGrid WordPress plugin page, navigate to **Settings**, and click on the tab labeled **Subscription Widget**. ### Configuring Your Credentials To enable the Subscription Widget, you’ll first need an API key to authenticate your access to SendGrid services. If you’ve already set up the General settings for the plugin, you may choose to use the same API key by checking the “Use same authentication as transactional” option. Alternatively, you may create a separate API key specifically for uploading contacts from the Subscription Widget. We recommend creating this API Key dedicated to your WordPress plugin with only the [minimum permissions]({{root_url}}/for-developers/sending-email/wordpress-faq/) necessary to perform the plugin's tasks. This is a security best practice that prevents someone who might obtain your API Key from accessing all areas of your account. For a more detailed discussion of the benefits of API Key permissions, please see our documentation on [API Keys]({{root_url}}/ui/account-and-settings/api-keys/). To create a dedicated API Key for your plugin, log into your SendGrid account, navigate to **Settings** in the lefthand sidebar, and click on **API Keys**. You can learn more about API Keys and how to create them [here]({{root_url}}/ui/account-and-settings/api-keys/). ![]({{root_url}}/images/wp_subscription_widget_1.png) ### Choosing Your Marketing Campaigns Recipient List After you set up a valid API key you must choose a specific list where your new contacts will be stored. ![]({{root_url}}/images/wp_subscription_widget_2.png) If you don't have a list set up for your signups from the Subscription Widget, open your SendGrid Dashboard, click on **Marketing Campaigns** in the sidebar, then select **Contacts** and [create a new list]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/). ![]({{root_url}}/images/wp_subscription_widget_2_1.png) ### Configuring Your Subscription Widget Form Once you have selected the contact list to which you would like your new signups to be uploaded, simply complete the form to reflect your preferences. You can decide whether you’ll include first and last names on your signup form and whether they’ll be required. You can also craft the subject line and content of the opt-in confirmation email. Lastly, you’ll be able to choose the page your new signups see upon clicking the confirmation link within the opt-in confirmation email. <call-out> Note: The default text [my site name] is **not** a substitution tag. You should replace the text within the "Signup email subject" field with your entire desired subject text. </call-out> ![]({{root_url}}/images/wp_subscription_widget_3.png) When writing the content for your signup confirmation email, you can choose between either HTML or Plain Text. ![]({{root_url}}/images/signup_email_html_text.png) Finally, select the WordPress page that will be displayed to the user by selecting it from the drop down menu on the settings page. ### Configuring Your Subscription Opt-In Confirmation Page If you would like to create your own custom opt-in confirmation page, simply create a static WordPress page as you would for any other area of your site (for example, your "About" or "Contact" page). ![]({{root_url}}/images/wp_plugin_confirmation_page.png) You may use the following substitution tags when building your confirmation page: - **[sendgridSubscriptionFirstName]** - the first name of your new subscriber - **[sendgridSubscriptionLastName]** - the last name of your new subscriber - **[sendgridSubscriptionEmail]** - the email address for your new subscriber Once you have created and saved this new page, it will appear in the dropdown menu alongside the "Default Confirmation Page" option. ![]({{root_url}}/images/sign_up_confirmation_page_option.png) For more information on how to create a new WordPress page, please visit the [WordPress documentation](https://codex.wordpress.org/Pages). ### Form Customization If you want to customize your subscription form, you can do so from the settings page. You can set labels for the "First Name", "Last Name", and "Email" fields in addition to the "Subscribe" button. You can also adjust the padding surrounding the input fields and buttons. ![]({{root_url}}/images/form_customization.png) If you want additional or advanced configuration options (for example, CSS styles), you can use the following .css classes: - `sendgrid_mc_label` for the labels - `sendgrid_mc_input` for the input fields - `sendgrid_mc_button` for the subscribe button For example, if you want your form to look like the following: ![]({{root_url}}/images/example_form.png) You would need to add the following to your CSS file: ```css .sendgrid_mc_label { color: #ff0000; } .sendgrid_mc_input { border: 3px solid #000000 !important; } .sendgrid_mc_button { background-color: #0000ff !important; } ``` ### Testing Your Subscription Widget Once you have configured your credentials and have selected a valid list for your new contacts, a form to test the subscription widget will appear at the bottom of the page of the Subscription Widget settings tab. You can test the subscription process by entering an email address and clicking **Test**. ![]({{root_url}}/images/wp_subscription_widget_4.png) The opt-in confirmation email you configured for the subscription widget will be sent to the test email address with a confirmation link. After clicking the confirmation link, your email address will be uploaded to your contacts within Marketing Campaigns and you will be redirected to the confirmation page that you specified in the subscription widget settings. ![]({{root_url}}/images/wp_subscription_widget_5.png) ### Using Your Subscription Widget To display the widget on your website, navigate to the widgets page in WordPress and, using drag and drop, add it to the section of your page where you would like it to be displayed. Remember that only the "email" field is required by default, but you may include the first and last name fields. ![]({{root_url}}/images/wp_subscription_widget_6.png) If you would like to add the “First Name” and “Last Name” fields, and require users to fill these fields when subscribing to your emails, simply navigate to the Subscription Widget tab, and select **Settings**. ![]({{root_url}}/images/wp_sub_widget_example.png) You may also configure your installation of the subscription widget by defining specific SendGrid settings as global variables within the wp-config.php file. See the next section for a list of specific settings and the corresponding PHP required to add those settings to the wp-config.php file. ## Manually Configuring Your Subscription Widget (Advanced) You can manually configure your subscription widget by defining your settings within the wp-config.php file. **It is important to note that the information presented below refers to the same configuration steps previously described.** There is no added functionality that comes with manually editing your wp-config.php file, it is simply an alternative method of changing the same settings. Continue reading below for examples of what PHP should be included in your wp-config.php file to configure your subscription widget. ### Manually Configuring Your Credentials In wp-config.php (Advanced) You can use an API key to authenticate when integrating with the SendGrid WordPress Subscription Widget You must set the Mail Send permissions to FULL ACCESS, Stats to READ ACCESS and Template Engine to READ or FULL ACCESS when creating the API Key, so you can send emails and see statistics on wordpress. For more information about API Key Permissions, click [here]({{root_url}}/ui/account-and-settings/api-keys/). ### Credentials Settings for the SendGrid WordPress Subscription Widget - **API Key**: `define('SENDGRID_API_KEY', 'sendgrid_api_key');` Your SendGrid API Key. ### Manually Configuring Your Email Settings (Advanced) ### Email Settings for the SendGrid WordPress Subscription Widget - **Send Method**: `define('SENDGRID_SEND_METHOD', 'api');` - The method used to deliver email. Can be either SMTP or the Web API. SMTP can only be used if the Swift Mailer plugin is installed. - **From name**: `define('SENDGRID_FROM_NAME', 'Example Name');` - The name of the sender. - **From email**: `define('SENDGRID_FROM_EMAIL', 'from_email@example.com');` - The email address of the sender. - **Reply to email**: `define('SENDGRID_REPLY_TO', 'reply_to@example.com');` - The email address that will populate the "reply to" field when recipients click the "reply" button. - **Categories**: `define('SENDGRID_CATEGORIES', 'category_1,category_2');` - Any [categories]({{root_url}}/ui/analytics-and-reporting/categories/) that you would like to tag your WordPress emails with. <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> - **Template**: `define('SENDGRID_TEMPLATE', 'templateID');` - The template that you would like to apply to your WordPress emails. - **Content**: `define('SENDGRID_CONTENT_TYPE', 'html');` - Denotes the type of data included in your email. Can be "plaintext" or "html". ### Manually Configuring Your Widget Settings (Advanced) ### Widget Settings - **Marketing Campaigns API Keys**: `define('SENDGRID_MC_API_KEY', 'sendgrid_mc_api_key');` - Your API Key generated to authenticate use of the Marketing Campaigns API. - **Use the same authentication as for sending emails ('true' or 'false':)**: `define('SENDGRID_MC_OPT_USE_TRANSACTIONAL', 'false');` - Indicates if your API Key used to authenticate sending emails should also be used when adding new contacts via the subscription widget. - **Contact list ID**: `define('SENDGRID_MC_LIST_ID', 'listID');`- The ID of the contact list that you would like your new subscribers to be added to. To find your list ID, navigate to **Marketing Campaigns**, then click **Contacts**. Click on the list you would like to use. When viewing the list, the last 6 digits of the URL make up the list ID. * **Display the first and last name fields ('true' or 'false')**: `define('SENDGRID_MC_OPT_INCL_FNAME_LNAME', 'true');` - Indicates whether you want to display fields for your subscribers to enter both their first and last names on the subscription form. * **First and last name fields are required ('true' or 'false')**: `define('SENDGRID_MC_OPT_REQ_FNAME_LNAME', 'true');` - Indicates whether you want to require your subscribers to submit both their first and last names on the subscription form. * **Signup confirmation email subject**: `define('SENDGRID_MC_SIGNUP_EMAIL_SUBJECT', 'Confirm subscription');` * **Signup confirmation email content**: `define('SENDGRID_MC_SIGNUP_EMAIL_CONTENT', '<a href="%confirmation_link%">click here</a>');` * **Signup confirmation page ID**: `define('SENDGRID_MC_SIGNUP_CONFIRMATION_PAGE', 'page_id');` The WordPress page ID of the page you would like to link users to when confirming their subscription. To find your page ID, log into your WordPress account and click **Pages** in the left hand nav of your dashboard. Select your confirmation page. In the URL you will see the text "post=XX" where XX represents your page ID. * **First Name Label**: `define('SENDGRID_MC_FIRST_NAME_LABEL', 'First Name');` * **Last Name Label**: `define('SENDGRID_MC_LAST_NAME_LABEL', 'Last Name');` * **Email Label**: `define('SENDGRID_MC_EMAIL_LABEL', ‘Email’);` * **Subscribe Label**: `define('SENDGRID_MC_SUBSCRIBE_LABEL', 'Subscribe');` ## Additional Resources - [SendGrid's WordPress Plugin]({{root_url}}/for-developers/sending-email/wordpress-plugin/) - [SendGrid's WordPress Integration FAQ]({{root_url}}/for-developers/sending-email/wordpress-faq/) ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-for-gravity-forms-submissions.md ================================================ --- seo: title: Sending New Emails via SendGrid For New Gravity Forms Submissions description: Learn how to send an email whenever you receive a new Gravity Form submission. keywords: integration, tutorial, Gravity Forms Submissions, SendGrid, Zapier title: Sending New Emails via SendGrid For New Gravity Forms Submissions group: partners weight: 0 layout: page navigation: show: true --- If you want to send a new SendGrid email every time you receive a Gravity Form submission, you can do that using [Zapier](http://zapier.com). You will need: * a [Gravity Forms](http://www.gravityforms.com) account * a [SendGrid](http://sendgrid.com) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To connect your Gravity Forms account to Zapier, you will need the Gravity Forms plugin with the Zapier add-on installed. You will also need a form created in Gravity forms. To get started with Gravity forms, and for information on creating forms and installing the add-ons that you will need, check [here](https://www.gravityhelp.com/documentation/article/getting-started/). Information for getting started with Gravity Forms on Zapier can be found [here](https://zapier.com/help/gravity-forms/#how-get-started-gravity-forms). To link your Gravity Forms to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send new emails via SendGrid for new Gravity Forms submissions](https://zapier.com/zapbook/zaps/4782/send-new-emails-via-sendgrid-for-new-gravity-forms-submissions/). 1. Follow the directions on the first step of the Zap to connect your Gravity Forms account to Zapier. 2. Choose your SendGrid account from the list of accounts, or connect a new account. 3. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 4. Using fields from Gravity Forms, create, and customize the **To**, **From**, and **Subject** email message that the Zap will send. ![Email entry](https://api.monosnap.com/rpc/file/download?id=5fpmLkDdv82LPlTeYCyhUE7bsFeSIE) 5. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, new Gravity Forms submissions will automatically send an SendGrid email. <call-out> If you ever want to change this Gravity Forms and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like. </call-out> You can also check out all that’s possible with [Gravity Forms on Zapier](https://zapier.com/zapbook/gravity-forms/), and other ways to connect [Gravity Forms and SendGrid](https://zapier.com/zapbook/gravity-forms/sendgrid). ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-for-new-webhook-data.md ================================================ --- seo: title: Send Emails Through SendGrid For New Caught Webhook Data description: Learn how to receive a SendGrid email for a new Event Webhook post by using Zapier. keywords: integrate, tutorial, Event Webhook, SendGrid, Zapier title: Send Emails Through SendGrid For New Caught Webhook Data group: partners weight: 0 layout: page navigation: show: true --- If you want to receive a SendGrid email every time you receive a new Event Webhook post, you can do that using [Zapier](http://zapier.com). You will need: * a [SendGrid](http://sendgrid.com) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To establish a Webhook on Zapier, you will need only your Zapier account. Zapier will set up a custom Webhook url, for information on how to get started using these Webhooks, check [here](https://zapier.com/help/webhooks/#how-get-started-webhooks-zapier). To link your Webhooks on Zapier to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send emails through SendGrid for new caught Webhook data](https://zapier.com/zapbook/zaps/4784/send-emails-through-sendgrid-for-new-caught-webhook-data/). 1. Zapier will automatically generate a Webhook for you to send requests to. When you have this, click **Ok, continue**. 2. Choose whether or not you wish to specify a **Child Key** for your Webhook. Click **Save + Continue**. 3. Choose your SendGrid account from the list of accounts or connect a new account. 4. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 5. Using fields from the Webhook, create and customize the **To**, **From**, and **Subject** email message that the Zap will send. ![Email entry](https://api.monosnap.com/rpc/file/download?id=nzgrqhMuvZtnagf2ns64uWZkF8P7od) 6. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, new Webhook payloads will automatically cause a corresponding SendGrid email to be sent. *Note: if you ever want to change this Zapier and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like.* You can also check out all that’s possible with [Webhooks on Zapier](https://zapier.com/zapbook/webhook/) and other ways to connect [Webhooks and SendGrid](https://zapier.com/zapbook/webhook/sendgrid). ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-for-postgre-sql-row-matches.md ================================================ --- seo: title: Sending SendGrid Emails For New PostgreSQL Custom Query Row Matches description: Learn how to use Zapier to send mail through SendGrid when new PostgreSQL rows are created. keywords: integrate, tutorial, PostgreSQL, SendGrid, Zapier title: Sending SendGrid Emails For New PostgreSQL Custom Query Row Matches group: partners weight: 0 layout: page navigation: show: true --- If you want to send emails automatically through SendGrid when new custom PostgreSQL rows are created, you can do that using [Zapier](http://zapier.com). You will need: * a [PostgreSQL](http://www.postgresql.com) account * a [SendGrid](http://sendgrid.com) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To connect your PostgreSQL account to Zapier you will need an active PostgreSQL, and a database that you wish to pull data from. To get started with PostgreSQL, including information on how to install the program and how to create a database, go [here](http://www.postgresql.org/docs/9.4/static/tutorial-start.html). You can learn more about getting started with PostgreSQL on Zapier, [here](https://zapier.com/help/postgresql/#how-get-started-postgresql). To link your PostgreSQL to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send SendGrid emails for new PostgreSQL custom query row matches](https://zapier.com/zapbook/zaps/4781/send-sendgrid-emails-for-new-postgresql-custom-query-row-matches/). 1. Choose your PostgreSQL account from the list of accounts, or connect a new account. 2. To connect a new account, you will need the IP address or hostname of where your database is. Input this data in the **Host** field, indicate if you use an alternate **Port**, and fill in the **Database** and **Username** fields with the appropriate data. You may also need to fill out the **Password** field if your database user requires it. ![Connecting PostgreSQL](https://api.monosnap.com/rpc/file/download?id=OTK4dRBb1xZSxiiBDQXS4owNzpOlOf) 3. Create or fill in the **Custom Query** you wish to use. Click **Save + Continue**. ![PostgreSQL selection](https://api.monosnap.com/rpc/file/download?id=BFLSEIzfoiaq6RfAGiP6wJ7Tj7OzaH) 4. Choose your SendGrid account from the list of accounts, or connect a new account. 5. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 6. Using fields from PostgreSQL, create and customize the email message that the Zap will send. The required fields for this step are **To**, **From**, and **Subject**, but you may fill in further fields if you desire to do so. ![Email creation](https://api.monosnap.com/rpc/file/download?id=PMa2LUCYaqGcvdy9pPUtMhtrUtp5nW) 7. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, a new SendGrid email will be sent whenever your custom query is matched in your PostgreSQL. <call-out> If you ever want to change this PostgreSQL and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like. </call-out> You can also check out all that’s possible with [PostgreSQL on Zapier](https://zapier.com/zapbook/postgresql/), and other ways to connect [PostgreSQL and SendGrid](https://zapier.com/zapbook/postgresql/sendgrid). ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-from-google-sheet-rows.md ================================================ --- seo: title: Sending SendGrid Emails From New Google Sheets Rows description: Learn how to use Zapier to automatically send mail when you update a Google Sheets document. keywords: integrate, tutorial, Google Sheets, SendGrid, Zapier title: Sending SendGrid Emails From New Google Sheets Rows group: partners weight: 0 layout: page navigation: show: true --- If you want to automatically send emails through your SendGrid account when you update your Google Sheets spreadsheets, you can do that using [Zapier](http://zapier.com). You will need: * a [Google Docs](https://docs.google.com/) account * a [SendGrid](http://sendgrid.com) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To connect your Google Sheets to Zapier, make sure [you have created a new sheet for this purpose](http://www.gcflearnfree.org/googlespreadsheets/8.2). You can learn more about getting started with Google Sheets on Zapier, [here](https://zapier.com/help/google-sheets/#how-get-started-google-sheets-zapier). To link your Google Sheets to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send SendGrid emails from new Google Sheets rows](https://zapier.com/zapbook/zaps/4783/send-sendgrid-emails-from-new-google-sheets-rows/). 1. Choose your Google Sheets account from the list of accounts, or connect a new account. 2. Choose the **Spreadsheet** and the **Worksheet** you wish to use. ![Google Sheets pages](https://api.monosnap.com/rpc/file/download?id=KXMJ5qmwH4piFKBkBZXiTbMFu2cTog) 3. Choose your SendGrid account from the list of accounts, or connect a new account. 4. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 5. Using fields from Google Sheets, create, and customize the **To**, **From**, and **Subject** email message that the Zap will send. ![Email content](https://api.monosnap.com/rpc/file/download?id=gmK4I07JxAKFtgoEBhJBwkdUh4fD7i) 6. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, newly updated rows in Google Sheets will send corresponding emails through your SendGrid account. <call-out> If you ever want to change this Google Sheets and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like. </call-out> You can also check out all that’s possible with [Google Sheets on Zapier](https://zapier.com/zapbook/google-sheets/), and other ways to connect [Google Sheets and SendGrid](https://zapier.com/zapbook/google-sheets/sendgrid). ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-to-tagged-infusionsoft-contacts.md ================================================ --- seo: title: Sending Emails From SendGrid to Tagged Infusionsoft Contacts description: Learn how to use Zapier to send email through your SendGrid account to your Infusionsoft contacts. keywords: integrate, tutorial, Infusionsoft, contacts, SendGrid, Zapier title: Sending Emails From SendGrid to Tagged Infusionsoft Contacts group: partners weight: 0 layout: page navigation: show: true --- If you want to send emails automatically from your SendGrid account to your Infusionsoft contacts, you can do that using [Zapier](http://zapier.com). You will need: * an [Infusionsoft](http://www.infusionsoft.com) account * a [SendGrid](http://sendgrid.com/) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To connect your Infusionsoft to Zapier you will need an active Infusionsoft account. To get started with Infusionsoft, go [here](http://help.infusionsoft.com/userguides/get-started). You can learn more about getting started with Infusionsoft on Zapier, [here](https://zapier.com/help/infusionsoft/#how-get-started-infusionsoft). To connect your Infusionsoft account to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send emails from SendGrid to tagged Infusionsoft Contacts](https://zapier.com/zapbook/zaps/2232/send-an-email-from-sendgrid-when-you-tag-a-contact-in-infusionsoft/). 1. Choose your Infusionsoft account from the list of accounts, or connect a new account. 2. To connect a new Infusionsoft account to your Zapier, simply login and click **Allow** on the pop-up window in the Zap when prompted. ![Infusionsoft login](http://cl.ly/image/2x3l3d2e0t3o/Image%202015-10-30%20at%2011.30.29%20AM.png) 3. Choose your SendGrid account from the list of accounts, or connect a new account. 4. You’ll then need to choose the Tag name you’d like the Zap to monitor. ![Infusionsoft Tag](http://cl.ly/image/3N1O0g0c3r3K/Image%202015-10-30%20at%2011.33.06%20AM.png) 5. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 6. Using fields from Infusionsoft, create and customize the **To**, **From**, and **Subject** email message that the Zap will send. 7. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, tagged contacts in Infusionsoft will automatically receive emails via SendGrid. <call-out> If you ever want to change this Infusionsoft and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like. </call-out> You can also check out all that’s possible with [Infusionsoft on Zapier](https://zapier.com/zapbook/infusionsoft/), and other ways to connect [Infusionsoft and SendGrid](https://zapier.com/zapbook/infusionsoft/sendgrid/). ================================================ FILE: content/docs/for-developers/sending-email/zapier-sending-when-new-firebase-child-records-added.md ================================================ --- seo: title: Sending SendGrid Email When New Firebase Child Records Are Added description: Learn how to use Zapier to send email when new Firebase Child Records Are Added. keywords: integrate, tutorial, Firebase, Child Records, SendGrid, Zapier title: Sending SendGrid Email When New Firebase Child Records Are Added group: partners weight: 0 layout: page navigation: show: true --- If you want to send a SendGrid email when you add new Firebase child records, you can do that using [Zapier](http://zapier.com). You will need: * a [Firebase](http://www.firebase.com) account * a [SendGrid](http://sendgrid.com) account * a [Zapier](http://zapier.com) account ## Steps 1. [Getting your accounts ready](#ready) 2. [Connecting your accounts](#connect) ### Getting your accounts ready<a name="ready"></a> To connect your Firebase account you will need an active Firebase account. To get started with Firebase, go [here](https://www.firebase.com/tutorial/). You can learn more about getting started with Firebase on Zapier, [here](https://zapier.com/help/firebase/#how-get-started-firebase). To link your Firebase to SendGrid, you must have an active SendGrid account. To learn more about getting started with SendGrid basics, start [here]({{root_url}}/api-reference/). For more information about getting started with SendGrid on Zapier, go [here](https://zapier.com/help/sendgrid/#how-get-started-sendgrid). ### Connecting your accounts<a name="connect"></a> Click here to [Send SendGrid email when new Firebase child records are added](https://zapier.com/zapbook/zaps/3291/send-emails-with-sendgrid-when-new-firebase-child-records-are-added/). 1. Choose your Firebase account from the list of accounts, or connect a new account. 2. To connect a new Firebase account to your Zapier, you will need to enter the name of the **Firebase instance** you wish to use, and the **Secret** to authenticate the connection. You can find your secret authentication under the Auth tab. ![Credentials](https://api.monosnap.com/rpc/file/download?id=mHKxFy2GGk7HAi3GiaWCjnlHFL5AwM) ![Secret](https://api.monosnap.com/rpc/file/download?id=qgDlpkBImMfmQgb8TeQCQEZXNK0wnc) 3. Enter the **Path to Data** that you wish for the Zap to watch for child records. ![Path to data](https://api.monosnap.com/rpc/file/download?id=ftCyfZYQCYwIxgDZ7m61vK9wcdU2F3) 4. Choose your account from the list of accounts, or connect a new account. 5. To connect your SendGrid account to Zapier for the first time, you will enter the credentials of an API/mail account. If you have not created this account, you can do so [here](https://sendgrid.com/credentials). ![Credential entry](https://api.monosnap.com/rpc/file/download?id=gAajRq9wMKNTN4HyEKzAMosD71ifb8) 6. Using fields from Firebase, create and customize the **To**, **From**, and **Subject** email message that the Zap will send. ![Email entry](https://api.monosnap.com/rpc/file/download?id=z8bVdXOXSPszyLTNfBf0lhSYrPMlcP) 7. Click **Save + Finish**. Now test the Zap to make sure it works. Once you’re satisfied with the results, new child records created in Firebase will send corresponding emails in SendGrid. <call-out> If you ever want to change this Firebase and SendGrid integration, just go to [your Zapier dashboard](https://zapier.com/app/dashboard) and tweak anything you'd like. </call-out> You can also check out all that’s possible with [Firebase on Zapier](https://zapier.com/zapbook/firebase/), and other ways to connect [Firebase and SendGrid](https://zapier.com/zapbook/firebase/sendgrid). ================================================ FILE: content/docs/for-developers/sending-email/zend.md ================================================ --- layout: page weight: 0 group: frameworks title: Zend seo: title: Send Email with Zend & SendGrid description: View instructions on how to easily send email with Zend using SendGrid, by setting up setting up Zen's mail module. navigation: show: true --- You can directly integrate Zend's mail module with SendGrid to use our SMTP servers for outgoing messages. ``` php <?php require_once '$HOME/sendgrid/Zend/library/Zend/Mail.php'; require_once '/$HOME/sendgrid/Zend/library/Zend/Mail/Transport/Smtp.php'; $smtpServer = 'smtp.sendgrid.net'; $username = 'username'; $api_key = 'api_key'; $config = array('ssl' => 'tls', 'port' => '587', 'auth' => 'login', 'username' => $username, 'api_key' => $api_key); $transport = new Zend_Mail_Transport_Smtp($smtpServer, $config); $mail = new Zend_Mail(); $mail->setFrom('sendeexampexample@example.com', 'Some Sender'); $mail->addTo('email@example.com','Some Recipient'); $mail->setSubject('Test Subject'); $mail->setBodyText('This is the text of the mail using Zend.'); $mail->send($transport); ?> ``` If you prefer a modular installation, then [check out Jurian Sluiman's SlmMail project at GitHub](https://github.com/juriansluiman/SlmMail.git). ================================================ FILE: content/docs/for-developers/tracking-events/analytics-with-keen-io.md ================================================ --- seo: title: Keen Integration description: Analyze, Visualize, and Store SendGrid Email Event Data keywords: Keen, integrate, event data, analytics title: Analyze, Visualize, and Store SendGrid Event Data with Keen group: partners weight: 142 layout: page navigation: show: true --- The SendGrid [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) lets you stream all [email events]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) directly to <a href="https://keen.io/users/signup?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs">Keen</a> for real-time analysis and long term raw storage. It only takes a couple of minutes to start streaming email event data from SendGrid to Keen, and once you do, you’ll get tools to create flexible email analytics and stunning dashboards. ## Sending Your SendGrid Data to Keen **Create a Keen and SendGrid account** 1. Create a [Keen account](https://keen.io/users/signup?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs) if you don't already have one. 1. Add a new project in the Keen UI for your SendGrid Email Event Data. 1. Navigate to the Access tab and copy your Project ID and API Write Key. 1. Create a [SendGrid account](https://sendgrid.com/user/signup). **Activate SendGrid's Event Notification App** 1. Log into your SendGrid account. 1. Click **Settings** from the left menu. 1. Select [**Mail Settings**](http://app.sendgrid.com/settings/mail_settings) and then click **Event Webhook**. ![SendGrid - Mail Settings - Event Webhook]({{root_url}}/images/keen/sendgrid_mailsettings_eventwebhook.png) ### Set the HTTP POST URL The HTTP Post URL is the endpoint where SendGrid will stream all of your email data. ``` https://api.keen.io/3.0/projects/YOUR_KEEN_PROJECT_ID/email/sendgrid/1.0?api_key=YOUR_KEEN_API_WRITE_KEY ``` 1. Copy and paste the above URL into the HTTP POST URL field. Make sure to replace `YOUR_KEEN_PROJECT_ID` and `YOUR_KEEN_API_WRITE_KEY` with your Project ID and API Write Key available in the Access tab. Set Authorization Method to **None**. 2. In the settings, select the events you want to post to Keen (why not all of them?). To do this, check **Select All** under **Events to be POSTed to your URL**. You can refer to SendGrid’s [event documentation]({{root_url}}/for-developers/tracking-events/event/) for more information on these events. That’s it! Now, as your emails make their way through SendGrid, all of the event information will be posted to Keen. A new Event Collection, aptly named for each type of email event, will be created within your Keen Project. ## Testing Your Integration To test that everything is working, navigate to **Event Webhook Settings** in the SendGrid app and then click **"Test Your Integration"**. This will send sample email data from SendGrid into your Keen Project. In the Keen UI, navigate to the **Streams** tab to check for sample SendGrid data. After you've confirmed the data was sent, enable the Event Webhook and your SendGrid email data will now be sent to Keen in real-time. ## Your Data: SendGrid Data Models In the SendGrid app, navigate to **Mail Settings** and then select **Event Webhook**. Each email event type that is selected will be recorded as a separate Event Collection in your Keen project. We recommended checking **Select All** to access full functionality of the Keen app’s reporting. The email events that are recorded are: - `email_bounce` - `email_click` - `email_deferred` - `email_delivered` - `email_dropped` - `email_group_resubscribe` - `email_group_unsubscribe` - `email_open` - `email_processed` - `email_spamreport` - `email_unsubscribe` As SendGrid email data streams to Keen, it will be enhanced using Keen's [Data Enrichment](https://keen.io/docs/streams/data-enrichment-overview/) capabilities. Keen’s data enrichments turn IP addresses into geographic locations and break out timestamps, URLs, and user agent strings into more easy-to-use data such as `device type`, `day_of_the_week`, and URL `path`. _To explore each data model:_ 1. Log into your Keen account. 1. Select your SendGrid Project and click **Streams**. 1. In the search bar type in “email” to check out your data collections associated with SendGrid email data. You can click into an email event to view all of the different data you have to work with. <call-out> Use the property `message_id` or `singlesend_name` contained in each event to track a particular email across all of these possible actions. Similarly, you can follow a particular user's behavior via the `email` property. </call-out> ## Using the Data Explorer *To use the Data Explorer:* 1. Log into your Keen account and then select your project. 1. Select **Streams**. 1. In the "Event Streams" search bar type in “email” to check out your data collections associated with SendGrid email data. A separate Event Collection, aptly named for each type of email event, is created within your Keen Project. ![Keen Event Streams - SenGrid Email Event Data]({{root_url}}/images/keen/sendgrid_stream_new.png) 4. Run some basic queries by selecting **Explorer** and entering `count` as the “Analysis Type,” select `email_delivered` as your “Collection Name,” and click “**Run Query**. ![Explorer to Run Query]({{root_url}}/images/keen/sendgrid_basic_count_new.png) The breadth of analysis you can do is pretty vast. [Here's a link](https://keen.io/docs/compute/) to read up on the types of queries you can do with Keen. Some example query types are sums, averages, min or max, funnels, and select_unique. Keen also offers a [step-by-step guide](https://www.keen.io/blog/how-to-build-sendgrid-email-marketing-dashboard-with-keenio) on creating queries for a SendGrid email marketing dashboard. For some extra-pretty graphs and custom analyses here are some tips: - Adding an “Interval” (e.g. “daily”) will give you a line graph over time (Ex. Number of emails processed daily for the previous 30 days) - Include a “Group By” property (e.g. “campaign”) to view results categorically - Use “Filters” to refine the scope of your query - Use the chart type drop down on the upper right to choose how you view data: as an area graph, bar chart, column chart, table, [or more](https://keen.io/docs/data-visualizations/widgets/funnel-chart/) - Download a CSV of the data you found by clicking on the “Download CSV” button ![Explorer Sample Query]({{root_url}}/images/keen/sendgrid_sample_query.png) ## Save Your Query & Make Your First Dashboard Do you often run the same analysis on a regular basis, or want to be able to save a quick link to your work to revisit again sometime? Once you’ve found the query you need, you can either copy the URL right from your browser’s address bar and share it with a colleague, or you can save the query and make yourself a dashboard with Keen. Here’s how: 1. Save your query. Create your query in the Explorer and then click **Run**. 2. After running the query, select **Save**. ![Save Your Query]({{root_url}}/images/keen/sendgrid_saved_query_new.png) Saved queries are a super user-friendly way to revisit your favorite metrics. Rather than entering the same query parameters over and over again, queries can be shared with your teammates. Notice that your saved query can be edited and cloned. Next, you'll want to add your graph to a dashboard. 1. Navigate to **Dashboards** and select **New Dashboard**. 1. Name your dashboard. 1. Add the query you saved by hovering over "Add item" and then dragging a metric chart into the dashboard. Select the saved query from a dropdown in the right hand ribbon. 1. Click **Save** to save your Dashboard. ![Add Query to Dashboard]({{root_url}}/images/keen/sendgrid_create_dashboard_new.png) Congratulations! You’ve created your first dashboard! ## Embedding SendGrid Analytics Into Your App With Keen, you will have access to all of your raw data for as long as you need it. An archive of all of your email data is created, which means you will have access to your historical data and can query for past user behavior. Just like SendGrid, Keen is 100% powered by APIs. This means you can embed rich analytics anywhere you can write code. Many customers find it useful to embed analytics into their products for their customers or customer success teams. Here’s a link to our [Customer Facing Analytics Guide](https://keen.io/docs/visualize/customer-facing-analytics/) that will give you step-by-step instructions on how to embed your SendGrid analytics into your product. Some customers also take advantage of Keen's [S3 Streaming](https://keen.io/docs/streams/extended-functionality/amazon-s3/) capabilities to write a copy of all their data to AWS. ## Additional Resources: - Check out [Keen's API reference](https://keen.io/docs/api/) to learn about the full capability of the platform. - Build a campaign and email marketing dashboard. Create and display your email metrics using [Keen's Data Viz Library](http://keen.io/docs/data-visualizations/create-dashboard/). - SendGrid's complete [Event Webhook Documentation]({{root_url}}/for-developers/tracking-events/event/) is a great resource on SendGrid email events. As you start to do more analysis, it's worth a read. You can even skip a lot of the sections because we've done much of the work for you. ================================================ FILE: content/docs/for-developers/tracking-events/csharp-code-example.md ================================================ --- layout: page weight: 10 title: Event Webhook C# Code Example group: code-examples navigation: show: true --- ## Parse Webhook In this example, we want to parse all emails at *address*@email.sendgrid.biz and post the parsed email to http://sendgrid.biz/upload Given this scenario, the following are the parameters you would set at the [Parse API settings page](https://sendgrid.com/developer/reply): ``` Hostname: email.sendgrid.biz ``` ``` URL: http://sendgrid.biz/upload ``` Put this C\# model in your models folder: ```csharp /// <summary> /// A model with the data format of the Inbound Parse API's POST /// </summary> public class Email { /// <summary> /// The Domain Keys Identified Email code for the email /// </summary> public string Dkim { get; set; } /// <summary> /// The email address that the email was sent to /// </summary> public string To { get; set; } /// <summary> /// The HTML body of the email /// </summary> public string Html { get; set; } /// <summary> /// The email address the email was sent from /// </summary> public string From { get; set; } /// <summary> /// The Text body of the email /// </summary> public string Text { get; set; } /// <summary> /// The Ip address of the sender of the email /// </summary> public string SenderIp { get; set; } /// <summary> /// A JSON string containing the SMTP envelope. This will have 2 variables: to, which is an array of recipients, and from, which is the return path for the message. /// </summary> public string Envelope { get; set; } /// <summary> /// Number of attachments included in email /// </summary> public int Attachments { get; set; } /// <summary> /// The subject of the email /// </summary> public string Subject { get; set; } /// <summary> /// A JSON string containing the character sets of the fields extracted from the message. /// </summary> public string Charsets { get; set; } /// <summary> /// The results of the Sender Policy Framework verification of the message sender and receiving IP address. /// </summary> public string Spf { get; set; } } ``` To test this, we send an email to example@example.com, and put the following method in our ApiController. Note: Don't forget the attribute. ```csharp // POST api/inbound [HttpPost] public async Task<HttpResponseMessage> Post() { var root = HttpContext.Current.Server.MapPath("~/App_Data"); var provider = new MultipartFormDataStreamProvider(root); await Request.Content.ReadAsMultipartAsync(provider); var email = new Email { Dkim = provider.FormData.GetValues("dkim").FirstOrDefault(), To = provider.FormData.GetValues("to").FirstOrDefault(), Html = provider.FormData.GetValues("html").FirstOrDefault(), From = provider.FormData.GetValues("from").FirstOrDefault(), Text = provider.FormData.GetValues("text").FirstOrDefault(), SenderIp = provider.FormData.GetValues("sender_ip").FirstOrDefault(), Envelope = provider.FormData.GetValues("envelope").FirstOrDefault(), Attachments = int.Parse(provider.FormData.GetValues("attachments").FirstOrDefault()), Subject = provider.FormData.GetValues("subject").FirstOrDefault(), Charsets = provider.FormData.GetValues("charsets").FirstOrDefault(), Spf = provider.FormData.GetValues("spf").FirstOrDefault() }; // The email is now stored in the email variable return new HttpResponseMessage(HttpStatusCode.OK); } ``` The above code used the following `using`'s ```csharp using System.Linq; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.Web; using System.Web.Http; ``` ================================================ FILE: content/docs/for-developers/tracking-events/event-kit.md ================================================ --- seo: title: SendGrid EventKit description: Learn how to better track your data with the open source SendGrid EventKit. keywords: event, store, clicks, opens, download, heroku, eventkit, event, kit, database, post, activity title: SendGrid EventKit group: partners weight: 0 layout: page navigation: show: true --- SendGrid's [Event Notification]({{root_url}}/for-developers/tracking-events/event/) feature allows you to receive POST data for your email events such as Opens, Clicks, Deliveries, and much more. However, traditionally this feature requires that you set up a separate database on your own to receive and store this posted data. While highly customizable, this method can be development and time intensive. Our open source EventKit app alleviates the hassle of needing to set up an endpoint on your own domain, and provides a simple yet powerful user interface to view and sort your SendGrid event data. Check out the videos below to walk you through the setup and configuration of EventKit. [Click here](https://github.com/sendgrid/eventkit-rails) to visit the EventKit GitHub repository. ## Learn how to install the Event Kit app using a free [Heroku](https://www.heroku.com/) instance by watching this step-by-step video: <iframe src="https://player.vimeo.com/video/167121552" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## Once you have EventKit set up, watch this video to learn more about the features within as well as how to navigate the user interface. <iframe src="https://player.vimeo.com/video/179804115" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ================================================ FILE: content/docs/for-developers/tracking-events/event.md ================================================ --- seo: title: Event Webhook Reference description: Full Event Webhook event list and descriptions, event examples, and the objects each event contains. keywords: event webhook API reference, reference, events, event webhook title: Event Webhook Reference group: reference-troubleshooting weight: 90 layout: page navigation: show: true --- ## Security Features We recommend securing the Event Webhook data using our Signed Event Webhook, OAuth 2.0, or both. For more information about Event Webhook security, see [Getting Started with the Event Webhook Security Features]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook-security-features/). Security features are not required for setup, but they are highly recommended for any use of the Event Webhook beyond initial testing. <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> ## Events Events are generated when email is processed by SendGrid and email service providers. There are 2 types of events - delivery and engagement events. Delivery events indicate the status of email delivery to the recipient. Engagement events indicate how the recipient is interacting with the email. Here is an event response that includes an example of each type of event: ```json [ { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "processed", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "deferred", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "response": "400 try again later", "attempt": "5" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "delivered", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "response": "250 OK" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "open", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip": "255.255.255.255" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "click", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip": "255.255.255.255", "url": "http://www.sendgrid.com/" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "bounce", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "reason": "500 unknown recipient", "status": "5.0.0" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "dropped", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "reason": "Bounced Address", "status": "5.0.0" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "spamreport", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "unsubscribe", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id" }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "group_unsubscribe", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip": "255.255.255.255", "url": "http://www.sendgrid.com/", "asm_group_id": 10 }, { "email": "example@test.com", "timestamp": 1513299569, "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>", "event": "group_resubscribe", "category": "cat facts", "sg_event_id": "sg_event_id", "sg_message_id": "sg_message_id", "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip": "000.000.000.000", "url": "http://www.sendgrid.com/", "asm_group_id": 10 } ] ``` ### Delivery events Delivery events include processed, dropped, delivered, deferred, and bounce. <table class="table"> <colgroup> <col class="table-col-100"> <col class="table-col-200"> <col> </colgroup> <tbody> <tr> <th>Event</th> <th>Description</th> <th>Example webhook response</th> </tr> <tr> <td><a name="processed"></a>Processed</td> <td>Message has been received and is ready to be delivered.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "pool": { "name": "new_MY_test", "id": 210 }, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"processed", "category":"cat facts", "sg_event_id":"rbtnWrG1DVDGGGFHFyun0A==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.000000000000000000000" } ] ``` </td> </tr> <tr> <td><a name="dropped"></a>Dropped</td> <td>You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if Spam Checker app is enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"dropped", "category":"cat facts", "sg_event_id":"zmzJhfJgAfUSOW80yEbPyw==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "reason":"Bounced Address", "status":"5.0.0" } ] ``` </td> </tr> <tr> <td><a name="delivered"></a>Delivered</td> <td>Message has been successfully delivered to the receiving server.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"delivered", "category":"cat facts", "sg_event_id":"rWVYmVk90MjZJ9iohOBa3w==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "response":"250 OK" } ] ``` </td> </tr> <tr> <td><a name="deferred"></a>Deferred</td> <td>Receiving server temporarily rejected the message.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"deferred", "category":"cat facts", "sg_event_id":"t7LEShmowp86DTdUW8M-GQ==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "response":"400 try again later", "attempt":"5" } ] ``` </td> </tr> <tr> <td><a name="bounce"></a>Bounce</td> <td>Receiving server could not or would not accept mail to this recipient permanently. If a recipient has previously unsubscribed from your emails, the message is dropped.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"bounce", "category":"cat facts", "sg_event_id":"6g4ZI7SA-xmRDv57GoPIPw==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "reason":"500 unknown recipient", "status":"5.0.0", "type":"bounce" } ] ``` </td> </tr> <tr> <td><a name="blocked"></a>Blocked</td> <td>Receiving server could not or would not accept the message temporarily. If a recipient has previously unsubscribed from your emails, the message is dropped.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"bounce", "category":"cat facts", "sg_event_id":"6g4ZI7SA-xmRDv57GoPIPw==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "reason":"500 unknown recipient", "status":"5.0.0", "type":"blocked" } ] ``` </td> </tr> </tbody> </table> ### Engagement events Engagement events include open, click, spam report, unsubscribe, group unsubscribe, and group resubscribe. <table class="table"> <colgroup> <col class="table-col-100"> <col class="table-col-200"> <col> </colgroup> <tbody> <tr> <th>Event</th> <th>Description</th> <th>Example webhook response</th> </tr> <tr> <td><a name="open"></a>Open</td> <td>Recipient has opened the HTML message. Open Tracking needs to be enabled for this type of event.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"open", "category":"cat facts", "sg_event_id":"FOTFFO0ecsBE-zxFXfs6WA==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip":"255.255.255.255" } ] ``` </td> </tr> <tr> <td><a name="click"></a>Click</td> <td>Recipient clicked on a link within the message. Click Tracking needs to be enabled for this type of event.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"click", "category":"cat facts", "sg_event_id":"kCAi1KttyQdEKHhdC-nuEA==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip":"255.255.255.255", "url":"http://www.sendgrid.com/" } ] ``` </td> </tr> <tr> <td><a name="spamreport"></a>Spam Report</td> <td>Recipient marked message as spam.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"spamreport", "category":"cat facts", "sg_event_id":"37nvH5QBz858KGVYCM4uOA==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0" } ] ``` </td> </tr> <tr> <td><a name="unsubscribe"></a>Unsubscribe</td> <td>Recipient clicked on the 'Opt Out of All Emails' link (available after clicking the message's subscription management link). Subscription Tracking needs to be enabled for this type of event.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"unsubscribe", "category":"cat facts", "sg_event_id":"zz_BjPgU_5pS-J8vlfB1sg==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0" } ] ``` </td> </tr> <tr> <td><a name="groupunsubscribe"></a>Group Unsubscribe</td> <td>Recipient unsubscribed from a specific group either by clicking the link directly or updating their preferences. Subscription Tracking needs to be enabled for this type of event.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"group_unsubscribe", "category":"cat facts", "sg_event_id":"ahSCB7xYcXFb-hEaawsPRw==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip":"255.255.255.255", "url":"http://www.sendgrid.com/", "asm_group_id":10 } ] ``` </td> </tr> <tr> <td><a name="groupresubscribe"></a>Group Resubscribe</td> <td>Recipient resubscribed to a specific group by updating their preferences. Subscription Tracking needs to be enabled for this type of event.</td> <td> ```raw [ { "email":"example@test.com", "timestamp":1513299569, "smtp-id":"<14c5d75ce93.dfd.64b469@ismtpd-555>", "event":"group_resubscribe", "category":"cat facts", "sg_event_id":"w_u0vJhLT-OFfprar5N93g==", "sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0", "useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "ip":"255.255.255.255", "url":"http://www.sendgrid.com/", "asm_group_id":10 } ] ``` </td> </tr> </tbody> </table> <call-out type="warning"> Events like deferrals or bounces may or may not have an IP included in their post. Some examples where this will happen may include in internal deferrals. This is where we have already determined an issue at a specific MX records and are waiting for that issue to clear before trying to deliver more mail. Since no action is taken no IP can be logged taking an action. Another example would be a delayed bounce. This is where mail is accepted for delivery but later is rejected after the SMTP conversation is over. Since the SMTP conversation is no longer happening a new conversation is started where much of the previous context is lost. This results in delayed bounces not having an IP and other information. </call-out> ## Event objects <table class="table auto"> <tr> <th></th> <th><a href="#processed">Processed</a></th> <th><a href="#dropped">Dropped</a></th> <th><a href="#delivered">Delivered</a></th> <th><a href="#deferred">Deferred</a></th> <th><a href="#bounce">Bounce</a></th> <th><a href="#opened">Opened</a></th> <th><a href="#clicked">Clicked</a></th> <th><a href="#spamreport">Spam Report</a></th> <th><a href="#unsubscribe">Unsubscribe</a></th> <th><a href="#groupunsubscribe">Group Unsubscribe</a></th> <th><a href="#groupresubscribe">Group Resubscribe</a></th> </tr> <tr> <td><a href="#email">email</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#timestamp">timestamp</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#event">event</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#smtpid">smtp-id</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#useragent">useragent</a></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td>X</td> <td>X</td> <td></td> <td></td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#ip">ip</a></td> <td></td> <td></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td></td> <td></td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#sgeventid">sg_event_id</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#sgmessageid">sg_message_id</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X*</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#reason">reason</a></td> <td></td> <td>X</td> <td></td> <td>X</td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#status">status</a></td> <td></td> <td></td> <td></td> <td></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#response">response</a></td> <td></td> <td></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#tls">tls</a></td> <td></td> <td></td> <td>X</td> <td></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#url">url</a></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#category">category</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td></td> <td></td> </tr> <tr> <td><a href="#asmgroupid">asm_group_id</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td></td> <td></td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#uniqueargs">unique_args</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#marketingcampaignid">marketing_campaign_id</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#marketingcampaignname">marketing_campaign_name</a></td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> <td>X</td> </tr> <tr> <td><a href="#attempt">attempt</a></td> <td></td> <td></td> <td></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td><a href="#pool">pool</a></td> <td>X</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table> \* In the case of a delayed or asynchronous bounce, the message ID will be unavailable. ### JSON objects - <a name="email"></a>`email` - the email address of the recipient - <a name="timestamp"></a>`timestamp` - the <a href="https://en.wikipedia.org/wiki/Unix_time">UNIX timestamp</a> of when the message was sent - <a name="event"></a>`event` - the event type. Possible values are processed, dropped, delivered, deferred, bounce, open, click, spam report, unsubscribe, group unsubscribe, and group resubscribe. - <a name="smtpid"></a>`smtp-id` - a unique ID attached to the message by the originating system. - <a name="useragent"></a>`useragent` - the user agent responsible for the event. This is usually a web browser. For example, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36". - <a name="ip"></a>`ip` - the IP address used to send the email. For `open` and `click` events, it is the IP address of the recipient who engaged with the email. - <a name="sgeventid"></a>`sg_event_id` - a unique ID to this event that you can use for deduplication purposes. These IDs are up to 100 characters long and are URL safe. - <a name="sgmessageid"></a>`sg_message_id` - a unique, internal SendGrid ID for the message. The first half of this ID is pulled from the `smtp-id`. The message ID will be included in most cases. In the event of an asynchronous bounce, the message ID will not be available. An asynchronous bounce occurs when a message is first accepted by the receiving mail server and then bounced at a later time. When this happens, there is less information available about the bounce. - <a name="reason"></a>`reason` - any sort of error response returned by the receiving server that describes the reason this event type was triggered. - <a name="status"></a>`status` - status code string. Corresponds to HTTP status code - for example, a JSON response of 5.0.0 is the same as a 500 error response. - <a name="response"></a>`response` - the full text of the HTTP response error returned from the receiving server. - <a name="tls"></a>`tls` - indicates whether TLS encryption was used in sending this message. For more information about TLS, see the [TLS Glossary page]({{root_url}}/glossary/tls/). - <a name="url"></a>`url` - the URL where the event originates. For click events, this is the URL clicked on by the recipient. - <a name="url_offset"></a>`url_offset` - if there is more than one of the same links in an email, this tells you which of those identical links was clicked. - <a name="attempt"></a>`attempt` - the number of times SendGrid has attempted to deliver this message. - <a name="category"></a>`category` - [Categories]({{root_url}}/glossary/categories/) are custom tags that you set for the purpose of organizing your emails. If you send single categories as an array, they will be returned by the webhook as an array. If you send single categories as a string, they will be returned by the webhook as a string. - <a name="type"></a>`type` - indicates whether the bounce event was a hard bounce (type=bounce) or block (type=blocked) String categories: ```json [ { "email": "john.doe@sendgrid.com", "timestamp": 1337966815, "category": "newuser", "event": "open" }, { "email": "jane.doe@sendgrid.com", "timestamp": 1337966815, "category": "olduser", "event": "open" } ] ``` Array: ```json [ { "email": "john.doe@sendgrid.com", "timestamp": 1337966815, "category": ["newuser", "transactional"], "event": "open" }, { "email": "jane.doe@sendgrid.com", "timestamp": 1337966815, "category": "olduser", "event": "open" } ] ``` - <a name="asmgroupid"></a>`asm_group_id` - The ID of the unsubscribe group the recipient's email address is included in. ASM IDs correspond to the ID that is returned when you create an unsubscribe group. - <a name="uniqueargs"></a>`unique_args` or `custom_args` ## Unique Arguments and Custom Arguments Events generated by SendGrid can include [unique arguments]({{root_url}}/for-developers/sending-email/unique-arguments/) or custom arguments. <call-out> Unique arguments and custom arguments essentially have the same function. However, unique arguments are used in the SMTP API or V2 Mail Send, and custom arguments are used in the V3 Mail Send. </call-out> ### Unique Arguments To define and receive unique arguments when sending email with the [SMTP API]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) or the [v2 Mail Send endpoint](https://www.twilio.com/docs/sendgrid/api/v2/mail), use the `unique_args` parameter in the X-SMTPAPI header. For example, if you have an application and want to receive custom parameters such as the `userid` and the email `template`, you would submit them with the X-SMTPAPI header, as described [here]({{root_url}}/for-developers/sending-email/unique-arguments/). For example, if you include the following unique arguments in your x-smtpapi header for an email sent via the v2 Mail Send endpoint: ```json { "unique_args": { "userid": "1123", "template": "welcome" } } ``` You will receive the same unique argument included with the data posted to your Event Webhook: ```json [ { "sg_message_id": "sendgrid_internal_message_id", "email": "john.doe@sendgrid.com", "timestamp": 1337966815, "event": "click", "url": "https://sendgrid.com", "userid": "1123", "template": "welcome" } ] ``` <call-out type="warning"> You can create unique arguments with the same words as reserved keys, such as "event" or "email". However, SendGrid will default to the reserved key and NOT your unique argument for events that contain a reserved key as an object. An example of this is below. </call-out> ### Reserved Keys in Unique Arguments ```json //for this example, assume we're sending to john.doe@sendgrid.com { "unique_args": { "customerAccountNumber": "55555", "activationAttempt": "1", "New Argument 1": "New Value 1", "email": "jane.doe@sendgrid.com", "event": "SendEmail" } } ``` ### The resulting webhook call ```json [ { "event": "Processed", "timestamp": "123456789", "customerAccountNumber": "55555", "activationAttempt": "1", "New Argument 1": "New Value 1", "email": "john.doe@sendgrid.com" } ] ``` <call-out> You'll notice that the unique arguments, "event" and "email", were overwritten because they are reserved keys for SendGrid's values. </call-out> ### Custom Arguments Any custom arguments that you include with an email sent through [v3 Mail Send](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) gets added to your Event Webhook response. For example, if you were to include the following custom arguments in a personalization in your payload to the v3 Mail Send endpoint: ```json { "personalizations": [ { "to": [ { "email": "example@example.com" } ], "subject": "Hello, World!", "custom_args": { "userid": "1123" } } ], "from": { "email": "from_address@example.com" }, "content": [ { "type": "text/plain", "value": "Hello, World!" } ] } ``` The Event Webhook response: ```json [ { "userid": "1123" } ] ``` For emails sent through our Marketing Campaigns feature, we add Marketing Campaigns specific parameters to the Event Webhook. - <a name="singlesendid"></a>`singlesend_id` - <a name="singlesendname"></a>`singlesend_name` ### Example event from a Single Send: ```json [ { "category": [], "email": "email@example.com", "event": "open", "ip": "127.0.0.1", "mc_stats": "singlesend", "phase_id": "send", "send_at": "1591726752372", "sg_content_type": "html", "sg_event_id": "sendgrid_internal_event_id", "sg_message_id": "sendgrid_internal_message_id", "sg_template_id": "sendgrid_template_id", "sg_template_name": "sendgrid_template_name", "singlesend_id": "sendgrid_singlesend_id", "singlesend_name": "Example Single Send", "template_hash": "sendgrid_template_hash", "template_id": "sendgrid_template_id", "template_version_id": "sendgrid_template_version_id", "timestamp": 1591726752372, "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" } ] ``` - <a name="marketingcampaignid"></a>`marketing_campaign_id` - <a name="marketingcampaignname"></a>`marketing_campaign_name` ### Example event from a standard (non-A/B test) campaign send: ```json { "category": [], "email": "email@example.com", "event": "processed", "marketing_campaign_id": 12345, "marketing_campaign_name": "campaign name", "post_type": "event", "sg_event_id": "sendgrid_internal_event_id", "sg_message_id": "sendgrid_internal_message_id", "sg_user_id": 12345, "smtp-id": "", "timestamp": 1442349428 } ``` ### Example event from an A/B Test: `marketing_campaign_version` is displayed in the event data for emails sent as part of an A/B Test. The value for `marketing_campaign_version` are returned as `A`, `B`, `C`, etc. ```json { "category": [], "email": "tadpole_0010@stbase-018.sjc1.sendgrid.net", "event": "processed", "marketing_campaign_id": 23314, "marketing_campaign_name": "unique args ab", "marketing_campaign_version": "B", "marketing_campaign_split_id": 13471, "post_type": "event", "sg_event_id": "qNOzbkTuTNCdxa1eXEpnXg", "sg_message_id": "5lFl7Fr1Rjme_EyzNNB_5A.stfilter-015.5185.55F883172.0", "sg_user_id": 939115, "smtp-id": "<5lFl7Fr1Rjme_EyzNNB_5A@stismtpd-006.sjc1.sendgrid.net>", "timestamp": 1442349848 } ``` ### Example event from the winning phase of an A/B Test: ```json { "category": [], "email": "tadpole_0001@stbase-018.sjc1.sendgrid.net", "event": "delivered", "marketing_campaign_id": 23314, "marketing_campaign_name": "unique args ab", "post_type": "event", "response": "250 Ok ", "sg_event_id": "X2M1IUfMRhuAhWM0CbmFqQ", "sg_message_id": "fPJrJPIRTxC_obpgfTy74w.stfilter-015.5185.55F883564.0", "sg_user_id": 12345, "smtp-id": "", "timestamp": 1442349911 } ``` ### Legacy Marketing Email Unsubscribes For emails sent through our Legacy Marketing Email tool, unsubscribes look like the following example: ```json [ { "email": "nick@sendgrid.com", "timestamp": 1380822437, "newsletter": { "newsletter_user_list_id": "10557865", "newsletter_id": "1943530", "newsletter_send_id": "2308608" }, "category": ["Tests", "Newsletter"], "event": "unsubscribe" } ] ``` <a name="pool"></a>`pool` - For emails sent with a specified IP Pool, you can view the IP Pool in the event data for a processed event. ```json [ { "email": "john.doe@sendgrid.com", "smtp-id": "<14c583da911.2c36.1c804d@ismtpd-073>", "timestamp": 1427409578, "pool": { "name": "new_MY_test", "id": 210 }, "sg_event_id": "RHFZB1IrTD2Y9Q7bUdZxUw", "sg_message_id": "14c583da911.2c36.1c804d.filter-406.22375.55148AA99.0", "event": "processed" } ] ``` ### Click <table class="table table-bordered table-striped"> <thead> <tr> <th>event</th> <th>email</th> <th>url</th> <th>category</th> </tr> </thead> <tbody> <tr> <td>click</td> <td>Message recipient</td> <td>URL Clicked</td> <td>The category you assigned</td> </tr> </tbody> </table> ```json [ { "sg_event_id": "sendgrid_internal_event_id", "sg_message_id": "sendgrid_internal_message_id", "ip": "255.255.255.255", "useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53", "event": "click", "email": "email@example.com", "timestamp": 1249948800, "url": "http://yourdomain.com/blog/news.html", "url_offset": { "index": 0, "type": "html" }, "unique_arg_key": "unique_arg_value", "category": ["category1", "category2"], "newsletter": { "newsletter_user_list_id": "10557865", "newsletter_id": "1943530", "newsletter_send_id": "2308608" }, "asm_group_id": 1 } ] ``` ## Additional Resources - [Getting started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [Troubleshooting the event webhook]({{root_url}}/for-developers/tracking-events/troubleshooting/) - [An Event Webhook case study](https://sendgrid.com/blog/leveraging-sendgrids-event-api/) - [Webhook web libraries]({{root_url}}/for-developers/sending-email/libraries/) - [Analyze, Visualize, and Store SendGrid Event Data with Keen]({{root_url}}/for-developers/tracking-events/analytics-with-keen-io/) - [Email Event Data with Keen]({{root_url}}/ui/analytics-and-reporting/tracking-data-with-keen-io/) - [Run SQL on your Sengrid webhook data](https://pipedream.com/@dylburger/run-sql-on-sendgrid-engagement-data-for-free-p_X13CGV) ================================================ FILE: content/docs/for-developers/tracking-events/getting-started-event-webhook-security-features.md ================================================ --- layout: page weight: 0 title: Getting Started with the Event Webhook Security Features group: getting-started navigation: show: true seo: title: Getting Started with the Event Webhook Security Features description: Secure the Event Webhook using the Signed Webhook, OAuth 2.0, or both. keywords: Webhook, Signed, Cryptography, OAuth, ECDSA --- Twilio SendGrid's Event Webhook will notify a URL via HTTP POST with information about events that occur as your mail is processed. This article covers all you need to know to secure the Event Webhook, allowing you to verify that incoming requests originate from Twilio SendGrid. <call-out> For more information about working with the Event Webhook and the data it provides, please see [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/). </call-out> Twilio SendGrid provides two methods for securing the Event Webhook: cryptographic signing and [OAuth 2.0](https://oauth.net/2/). These two security methods are independent of one another and can be used simultaneously. ## The Signed Event Webhook When using the Signed Event Webhook, Twilio SendGrid will generate a [private and public key pair](https://www.twilio.com/blog/what-is-public-key-cryptography). The private key will be used to generate a signature that is posted to your HTTP webhook in the `"X-Twilio-Email-Event-Webhook-Signature"` header. You can verify the signature with the public key provided. More information is provided in the [Verification section](#verify-the-signature) of this page. ### Manage the Signed Event Webhook using the app #### Enable the Signed Event Webhook To enable the Signed Event Webhook and generate a key pair using the [SendGrid App](https://app.sendgrid.com/): 1. Navigate to [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the sidebar navigation. 2. Under "Event Settings," you should see “Signed Event Webhook Requests.” Click on the edit icon to load a sidebar modal. ![The signed event webhook settings page with the signed security option highlighted]({{root_url}}/images/signed-event-webhook-landing-page.png 'The Event Webhook settings page') 3. In the sidebar modal, click "Generate Verification Key." This will generate a private and public key. The public key will then be displayed to you. ![A sidebar modal with an option to generate a verification key and a status toggle showing if webhook signing is enabled or disabled]({{root_url}}/images/signed-event-webhook-modal.png 'Enable or disable the signed Event Webhook') 4. You can now copy this key and use it for verification. ![A sidebar modal with a verification key displayed for use in your code]({{root_url}}/images/signed-event-webhook-public-key.png 'A public verification key') 5. To confirm that the Signed Event Webhook is enabled, you can navigate back to [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) to verify that the setting is listed as "Enabled." #### Disable the Signed Event Webhook using the app To disable the Signed Event Webhook, which will delete any existing keys: 1. Navigate to [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the sidebar navigation. 2. Under "Event Settings," you should see "Signed Event Webhook Requests." Click the edit icon to load a sidebar modal. 3. When a signature exists, the side modal will show a toggle set to "Enabled" under the "Signed Event Webhook Request Status" label. Click the toggle to disable the feature and delete your existing keys. 4. Another modal will load asking you to confirm your decision. Click "Delete and Disable Signing" to confirm. ![A modal asking you to verify that you wish to delete your key and no longer sign the Event Webhook. You can either click to cancel or click to confirm.]({{root_url}}/images/signed-event-webhook-delete-key.png 'Confirm disabling the signed Event Webhook and deletion of current keys') ### Manage the Signed Event Webhook using the API Twilio SendGrid provides two Event Webhook API endpoints that allow you to manage signatures. A brief overview of both endpoints is provided below. You can find more at our [Event Webhook API Reference](https://sendgrid.api-docs.io/v3.0/webhooks/retrieve-event-webhook-settings). #### Enable/Disable the Signed Webhook To enable or disable the Signed Event Webhook, you can pass a `PATCH` request to `https://api.sendgrid.com/v3/user/webhooks/event/settings/signed`. This endpoint expects a JSON request body with the single required boolean field `enabled`. ```javascript { “enabled”: true } ``` #### Retrieve the Signed Webhook public key You can also retrieve your public key by passing a `GET` request to `https://api.sendgrid.com/v3/user/webhooks/event/settings/signed`. This endpoint accepts no query parameters and will return the string field `public_key` containing your current public key. #### Verify the signature Twilio SendGrid generates the private and public key pair using the [Elliptic Curve Digital Signature Algorithm (ECDSA)](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm). We recommend using a package or library suitable for your language to verify the signature. Libraries are listed below in [Sample verification libraries](#sample-verification-libraries). The general steps required to verify a signature are outlined below with [Golang](https://golang.org/) code samples. <call-out type="warning"> When verifying the signature, be aware that we deliver a payload that must be used in its raw bytes form. Transformations from raw bytes to a JSON string may remove characters that were used as part of the generated signature. </call-out> 1. Get the signature from the `"X-Twilio-Email-Event-Webhook-Signature"` HTTP header. ```go // Golang Example s := http.Request.Header.Get("X-Twilio-Email-Event-Webhook-Signature") ``` 2. Get the timestamp from the `"X-Twilio-Email-Event-Webhook-Timestamp"` HTTP header. ```go // Golang Example ts := http.Request.Header.Get("X-Twilio-Email-Event-Webhook-Timestamp") ``` 3. Base64 decode the signature. Then perform an ASN.1 unmarshal of the decoded signature into a string. This string will be in the form of `{r value},{s value}`. ```go // Golang Example signatureBytes, _ := base64.StdEncoding.DecodeString(s) ecdsaSig := struct { R *big.Int S *big.Int } asn1.Unmarshal(signatureBytes, &ecdsaSig) ``` 4. Generate a sha256 hash of the timestamp + payload (use raw bytes). ```go // Golang Example tsBytes := []byte(ts) payload, _ := ioutil.ReadAll(http.Request.Body) h := sha256.New() h.Write(tsBytes) h.Write(payload) hashedPayload := h.Sum(nil) ``` 5. Verify the signature. ```go // Golang Example // uses https://golang.org/pkg/crypto/ecdsa/ to perform the verification ecdsa.Verify(publicKey, hashedPayload, ecdsaSig.R, ecdsaSig.S) ``` 6. Again, the simplest way to verify the signature is to use a package or library that will abstract away this process into a helper method or function. #### Sample verification libraries The [Twilio SendGrid API libraries]({{root_url}}/for-developers/sending-email/libraries/) contain helpers to assist you when verifying the ECDSA signature. The links below will take you to the Event Webhook helper in each library. - [C# Event Webhook Helper](https://github.com/sendgrid/sendgrid-csharp/tree/master/src/SendGrid/Helpers/EventWebhook) - [Go Event Webhook Helper](https://github.com/sendgrid/sendgrid-go/tree/master/helpers/eventwebhook) - [Java Event Webhook Helper](https://github.com/sendgrid/sendgrid-java/tree/master/src/main/java/com/sendgrid/helpers/eventwebhook) - [Node.js Event Webhook Helper](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/eventwebhook) - [PHP Event Webhook Helper](https://github.com/sendgrid/sendgrid-php/tree/master/lib/eventwebhook) - [Python Event Webhook Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/eventwebhook) - [Ruby Event Webhook Helper](https://github.com/sendgrid/sendgrid-ruby/tree/master/lib/sendgrid/helpers/eventwebhook) ## OAuth 2.0 OAuth offers an additional and separate way of providing security controls for the Event Webhook. OAuth is an open authorization protocol used to share resources with applications. Rather than sharing your username and password with an application, granting total access to your account, OAuth enables scoped access to your resources. For more on OAuth and how it works, see the [OAuth community site](https://oauth.net/2/). The Twilio SendGrid Event Webhook uses the [Client Credentials](https://tools.ietf.org/html/rfc6749#section-1.3.4) OAuth grant type, which is an authorization workflow meant for machine-to-machine communication. This authorization method creates a token that Twilio SendGrid can pass to your app in an Authorization header, allowing you to verify that the request originated from Twilio SendGrid. ### OAuth Client Credentials flow OAuth can be confusing. To help illuminate the process, we have provided a description of the setup flow here. 1. You, the customer, have an app that provides an HTTP webhook. You want the Twilio SendGrid Event Webhook to make POST requests to this URL. To ensure that the requests you receive are actually from Twilio SendGrid, you implement OAuth. 2. This means you are responsible for generating a Client ID and Client Secret. You must also provide two URLs, the HTTP POST URL for your app and a URL to an authorization server or OAuth service. 3. When you give Twilio SendGrid all of this information, it will pass the Client ID and Client Secret to the Token URL (your authorization server/OAuth service). The authorization server will then use the Client ID and Client Secret to generate an access token. This token is sent back to Twilio SendGrid. 4. The access token is meaningless to Twilio SendGrid. It acts only as a key to pass back to your app at the HTTP POST URL. This will be done in an Authorization header. 5. Because this access token is shared among only your app, the authorization server, and Twilio SendGrid, you can trust requests delivered with the token are from a trusted source. 6. You can verify the access token is legitimate by checking with the authorization server that created it. ![A sequence diagram visualing showing the OAuth2 Client Credentials flow described in the list above.]({{root_url}}/images/oauth2-client-credentials-flow.png 'OAuth2.0 Client Credentials flow') ### Manage OAuth 2.0 using the app #### Enable OAuth To enable OAuth using the [SendGrid App](https://app.sendgrid.com/): 1. Navigate to [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the sidebar navigation. 2. Under "Event Settings," you should see "Event Webhook." Click the edit icon to load a sidebar modal. ![The Event Webhook settings page with the Event Webhook setting highlighted]({{root_url}}/images/oauth-landing-page.png 'The Event Webhook Settings Page') 3. In the sidebar modal, you should see an "Authorization Method" drop-down menu. Select "OAuth 2.0" to load the OAuth configuration fields. ![A sidebar modal with all the required fields for enabling OAuth 2.0 for the Event Webhook]({{root_url}}/images/oauth-modal-fields.png 'The OAuth 2.0 configuration fields') 4. Fill the OAuth configuration fields: 1. **Client ID**: Required to generate an authorization token. 2. **Client Secret**: Required to generate an authorization token. This secret is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. 3. **Token URL**: The URL where Twilio SendGrid should deliver the Client ID and Client Secret in order to create an access token. This URL should route to your own authorization server or an OAuth service such as Auth0 or Okta. 5. With the above steps completed, requests to your HTTP POST URL by Twilio SendGrid will contain the access token in an Authorization header. You can now use this token to verify the requests using your OAuth service or authorization server. <call-out> Please note, it is your responsibility to verify the access token used in requests to your HTTP POST URL. </call-out> #### Disable OAuth To disable OAuth using the [SendGrid App](https://app.sendgrid.com/): 1. [Navigate to Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the sidebar navigation. 2. Under "Event Settings," you should see "Event Webhook." Click the edit icon to load a sidebar modal. 3. In the sidebar modal, you should see an "Authorization Method" drop-down menu. Select "None" to disable authorization on the Event Webhook. 4. By selecting "None," requests to your HTTP POST URL by Twilio SendGrid will no longer contain an access token. ### Manage OAuth 2.0 using the API Twilio SendGrid allows you to manage OAuth setup using the API. A brief overview of enabling, disabling, and testing OAuth; and retrieving your OAuth credentials is provided below. You can find more at our [Event Webhook API Reference](https://sendgrid.api-docs.io/v3.0/webhooks/retrieve-event-webhook-settings). #### Enable/Disable OAuth To enable or disable OAuth, you can pass a `PATCH` request to `https://api.sendgrid.com/v3/user/webhooks/event/settings`. This endpoint expects a JSON request body. The three optional string fields used to manage OAuth are `oauth_client_id`, `oauth_client_secret`, and `oauth_token_url`. 1. **Client ID**: Required to generate an authorization token. 2. **Client Secret**: Required to generate an authorization token. This secret is needed only once to create an access token. SendGrid will store this secret, allowing you to update your Client ID and Token URL without passing the secret to SendGrid again. 3. **Token URL**: The URL where Twilio SendGrid should deliver the Client ID and Client Secret in order to create an access token. This URL should route to your own authorization server or an OAuth service such as Auth0 or Okta. Passing a request with valid values assigned to these fields will enable OAuth. Passing a request with empty values in these fields will disable OAuth. ```javascript { “oauth_client_id”: “yourclientidstringvalue”, “oauth_client_secret”: “yourclientsecretstringvalue”, “oauth_token_url”: “https://your-authorization-service.com” } ``` <call-out> Please note, there are other required fields when making requests to this API endpoint. Please see the [API reference for details](https://sendgrid.api-docs.io/v3.0/webhooks/retrieve-event-webhook-settings). </call-out> <call-out type="warning"> Using the v2 Web API's `eventnotify` API call will overwrite any previously configured Event Webhook notification settings, including OAuth 2.0. If your OAuth 2.0 settings are overwitten, please configure them again using either the [Mail Settings](https://app.sendgrid.com/settings/mail_settings) page or the [SendGrid v3 API](https://sendgrid.api-docs.io/v3.0/webhooks/update-event-notification-settings) </call-out> #### Testing the Event Webhook You can test your Webhook by passing a `POST` request to `https://api.sendgrid.com/v3/user/webhooks/event/test`. This request will send a fake event to your HTTP POST URL, which you can use to verify proper functionality. This endpoint expects a JSON request body with a required URL field. To test the OAuth setup, you must include the three optional OAuth fields. ```javascript { “url”: “https://your-http-post-url.com”, “oauth_client_id”: “yourclientidstringvalue”, “oauth_client_secret”: “yourclientsecretstringvalue”, “oauth_token_url”: “https://your-authorization-service.com” } ``` #### Retrieve your OAuth credentials. To retrieve your OAuth credentials, pass a `GET` request to `https://api.sendgrid.com/v3/user/webhooks/event/settings`. You do not need to pass any query parameters to this endpoint. Note that only the `oauth_client_id` and `oauth_token_url` will be returned. The `oauth_client_secret` will not be provided for security reasons. ## Helper Libraries Twilio SendGrid currently supports two helper libraries for working with the Event Webhook’s security features: [Golang](https://github.com/sendgrid/sendgrid-go/tree/master/helpers/eventwebhook) and [Java](https://github.com/sendgrid/sendgrid-java/tree/master/src/main/java/com/sendgrid/helpers). We have also provided a [Java code example on GitHub](https://github.com/sendgrid/sendgrid-java/blob/master/examples/helpers/eventwebhook/Example.java). ## Next steps Now that you know how to secure the Event Webhook, you can begin using your event data to better understand your email. To finish setting up the Webhook, see [Getting Started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) or jump right into the [Event Webhook Reference](/for-developers/tracking-events/event/). ================================================ FILE: content/docs/for-developers/tracking-events/getting-started-event-webhook.md ================================================ --- seo: title: Getting started with the Event Webhook description: Use RequestBin to get started or to troubleshoot your Event Webhook. keywords: webhook, RequestBin, troubleshoot, event webhook title: Getting started with the Event Webhook group: getting-started weight: 100 layout: page navigation: show: true --- SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. You can use this data to remove unsubscribes, react to spam reports, [determine unengaged recipients](https://sendgrid.com/blog/infer-engagement-with-the-event-api/), identify bounced email addresses, or create advanced analytics of your email program. With Unique Arguments and Category parameters, you can insert dynamic data that will help build a clear image of your email program. <call-out type="warning"> Categories and Unique Arguments will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> You should set up the Event Webhook if you want to keep track of more event data that we store for you. Due to the sheer volume of email we send, we can only store so much information. Your [Email Activity Feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) can hold up to 30 days worth of events. After that time passes, the email event data is gone. ## Getting started _To get started with the Event Webhook:_ 1. Go to the [Webhook tester](https://webhook.site/). 1. Copy the unique URL. 1. In a new window, open [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the [SendGrid UI](https://app.sendgrid.com). 1. Turn on **Event Webhook**. 1. In the **HTTP POST URL field**, paste the unique URL that you copied in step 2. 1. Select the Event notifications you would like to test. 1. Click the checkmark in the top corner to save these updates into your settings. 1. Click **Test Your Integration**. <br> This returns an HTTP POST containing a JSON array of your selected events in one request after a very short delay. Our servers send these POSTs to the URL you defined in the Event Notification app options. 1. Go back to the [Webhook tester](https://webhook.site/) and reload the page. <br> This loads the JSON array of your selected events that you set in the last step. <call-out type="warning"> The Webhook tester site has a public URL. This is usually safe for testing purposes, just make sure that you remove the `webhook.site` URL from your Event Notifications settings after you are done testing. </call-out> <call-out> You can also update your Event Webhook mail settings using the [PATCH /user/webhooks/event/settings](https://sendgrid.api-docs.io/v3.0/webhooks/update-event-notification-settings) API method, and you can test the webhook integration using the [POST /user/webhooks/event/test](https://sendgrid.api-docs.io/v3.0/webhooks/test-event-notification-settings) API method. </call-out> <call-out> If you want to test your webhook locally, deploy a local version of [Webhook tester](https://github.com/fredsted/webhook.site). Other browser options are [Beeceptor](https://beeceptor.com), or [ngrok](https://ngrok.com/). </call-out> ### Retry logic If your web server does not return a 2xx response type, we will retry a POST request until we receive a 2xx response or the maximum time has expired. All events are retried at increasing intervals for up to 24 hours after the event occurs. Please note that this time limit is a rolling 24 hours, which means new failing events will receive their own 24-hour retry period. ## Next steps Now that you understand what Event data looks like and the basics of the webhook, it's time to evaluate your own needs for the types of events you want to store, what kind of data storage that requires, and then switch your integration from the RequestBin test to a more permanent integration. ### Data Storage Events post every 30 seconds or when the batch size reaches 768 kilobytes - whichever occurs first. This is per server, so if you send a high volume of emails, the webhook URL may receive tens or even hundreds of posts per second. Because of this, storage should be a significant consideration of the type of integration you set up. Storage integrations are infinitely flexible, but here are some popular options: - Locally on your servers. - SendGrid's [open source Event Kit](https://github.com/sendgrid/eventkit-rails) stores the data on a Heroku instance. - SendGrid's partner Keen provides a platform to analyze, visualize, and store SendGrid Event data. For more information about getting started with Keen, see [Email Event Data with Keen]({{root_url}}/ui/analytics-and-reporting/tracking-data-with-keen-io/). - You could also use [Snowplow](https://github.com/snowplow/snowplow/wiki/SendGrid-webhook-setup), a web open source platform that supports SendGrid and stores the data on Amazon Redshift. - Several open source web libraries support SendGrid's Event Webhook. For a full list of these libraries, see the [Webhook libraries section]({{root_url}}/for-developers/sending-email/libraries/) of our API Libraries list. <call-out type="warning"> If your email traffic generates a lot of events, the incoming data can quickly overload a web server if not configured correctly. You can load test your endpoints with loader.io for free. </call-out> ### Integrating Once you choose a storage option, follow steps 3 through 8 in [Getting started](#getting-started]) to update your [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) in the [SendGrid UI](https://app.sendgrid.com). Update the **HTTP POST URL field** to your URL, and make sure you've selected the events that you want to receive. The Event Webhook does not follow redirects. If you want to receive encrypted posts, your callback URL needs to support TLS 1.2. ## Additional Resources - [Event Webhook reference]({{root_url}}/for-developers/tracking-events/event/) - [Troubleshooting the Event Webhook]({{root_url}}/for-developers/tracking-events/troubleshooting/) - [An Event Webhook case study](https://sendgrid.com/blog/leveraging-sendgrids-event-api/) - [Webhook web libraries]({{root_url}}/for-developers/sending-email/libraries/) - [Email Event Data with Keen]({{root_url}}/ui/analytics-and-reporting/tracking-data-with-keen-io/) - [Analyze, Visualize, and Store SendGrid Event Data with Keen]({{root_url}}/for-developers/tracking-events/analytics-with-keen-io/) ================================================ FILE: content/docs/for-developers/tracking-events/go-code-example.md ================================================ --- layout: page weight: 10 title: Event Webhook Go Code Example group: code-examples navigation: show: true --- ## Parse Webhook <call-out> We recommend using our official Go SDK, our client library with full documentation, when integrating with <a href="https://github.com/sendgrid/sendgrid-go/tree/master/helpers/inbound">SendGrid's Inbound Parse Webhook</a>. </call-out> In this example, we want to parse all emails at *address*@email.sendgrid.biz and post the parsed email to http://sendgrid.biz/upload Given this scenario, the following are the parameters you would set at the [Parse API settings page](https://sendgrid.com/developer/reply): ``` Hostname: email.sendgrid.biz ``` ``` URL: http://sendgrid.biz/upload ``` To test this scenario, we sent an email to example@example.com and created the following code: ```go package main import ( "fmt" "net/http" "io/ioutil" "log" "github.com/sendgrid/sendgrid-go" ) func Parse (w http.ResponseWriter, req *http.Request) { //Get Email Values to := req.FormValue("from") subject := req.FormValue("subject") body:= req.FormValue("text") //Get Uploaded File file, handler, err := req.FormFile("attachment1") if err != nil { fmt.Println(err) } data, err := ioutil.ReadAll(file) if err != nil { fmt.Println(err) } err = ioutil.WriteFile(handler.Filename, data, 0777) if err != nil { fmt.Println(err) } } func main() { http.HandleFunc("/upload", Parse) err := http.ListenAndServe(":3000", nil) if err != nil { log.Fatal("ListenAndServe: ", err) } } ``` ================================================ FILE: content/docs/for-developers/tracking-events/google-amp-for-email.md ================================================ --- layout: page weight: 0 group: partners title: SendGrid and Google AMP for Email seo: title: SendGrid and Google AMP for Email description: Use Google AMP to speed up mobile apps and websites. AMP for email enables interactivity in emails sent to gmail inboxes. navigation: show: true --- Google AMP (Accelerated Mobile Pages) is a proprietary Google technology built to speed up mobile apps and websites. AMP for Email is an extension and adaptation of the AMP technology that enables interactivity for Gmail recipients' email messages including carousels, expanding accordions, dynamically updating content, and more. For more information on Google’s [AMP specification for email](https://amp.dev/documentation/guides-and-tutorials/learn/email-spec/amp-email-format/?format=email), [best practices](https://developers.google.com/gmail/ampemail/testing-dynamic-email), and how to [register to use AMP](https://developers.google.com/gmail/ampemail/register) see Google’s AMP documentation. <call-out> SendGrid v3 API supports Google AMP for Email. You cannot send AMP content in SendGrid v2 API. Users can send AMP via SMTP however we strongly suggest sending it through V3. </call-out> ## Sending AMP with SendGrid SendGrid v3 API supports the AMP MIME part as well as the ordering recommended by Google to ensure compatibility across different mail clients. We recommend following [Google’s documentation](https://amp.dev/documentation/guides-and-tutorials/learn/amp-email-format#the-amphtml-email-format) to send AMP messages through SendGrid. ## Tracking AMP with SendGrid Open and click metrics for AMP will be aggregated with html open and click metrics in the SendGrid UI, but the AMP events are uniquely identified when collected via the [Event Webhook]({{root_url}}/for-developers/tracking-events/event/#engagement-events). ## AMP Open Identifier Open event tracking for AMP is identified by a JSON field called `sg_content_type`and will be `amp` instead of `html`. ``` { "email": "john.smith@sendgrid.com", "event": "open", "ip": "66.249.84.159", "sg_event_id": "zgAjGPn1TGmO62eSqw9VBQ", "sg_message_id": "zT-FDCibS4uwaz08cIX8_Q.filter0794p1las1-20361-5CCC528C-16.0", "sg_content_type": "amp", "timestamp": 1556901948, "useragent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)" } ``` ## AMP Click Identifier Click event tracking for AMP is identified by`url_offset.type` is `amp`. ``` { "email": "john.smith@sendgrid.com", "event": "click", "ip": "12.34.56.789", "sg_event_id": "fmip8TM8RWqJjT44cL5z-w", "sg_message_id": "zT-FDCibS4uwaz08cIX8_Q.filter0794p1las1-20361-5CCC528C-16 "timestamp": 1556901957, "url": "http://google.com/", "url_offset": { "index": 0, "type": "amp" }, "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" } ``` <call-out> Google requires all images to use HTTPS, which will require you to enable [SSL tracking]({{root_url}}ui/analytics-and-reporting/click-tracking-ssl/) on your SendGrid account in order to track opens. </call-out> ================================================ FILE: content/docs/for-developers/tracking-events/nodejs-code-example.md ================================================ --- layout: page weight: 10 title: Event Webhook Node.js Code Example group: code-examples navigation: show: true --- ## Parse Webhook In this example, we want to parse all emails at *address*@email.sendgrid.biz and post the parsed email to http://sendgrid.biz/parse . We will be using Node and the Express framework. Given this scenario, the following are the parameters you would set at the [Parse API settings page](https://sendgrid.com/developer/reply): ``` Hostname: email.sendgrid.biz ``` ``` URL: http://sendgrid.biz/parse ``` To test this scenario, we sent an email to example@example.com and created the following code: ```javascript var express = require('express'); var multer = require('multer'); var app = express(); app.configure(function(){   app.set('port', process.env.PORT || 3000);  app.use(multer()); }); app.post('/parse', function (req, res) {  var from = req.body.from; var text = req.body.text; var subject = req.body.subject; var num_attachments = req.body.attachments; for (i = 1; i <= num_attachments; i++){ var attachment = req.files['attachment' + i]; // attachment will be a File object } }); var server = app.listen(app.get('port'), function() { console.log('Listening on port %d', server.address().port); }); ``` ## Event Webhook To use the Event Webhook, you must first [setup Event Notification]({{root_url}}/for-developers/tracking-events/event/#setup). In this scenario, we assume you've set the Event Notification URL to go the endpoint `/event` on your server. Given this scenario the following code will allow you to process events: ```javascript var express = require('express'); var app = express(); app.configure(function(){   app.set('port', process.env.PORT || 3000);  app.use(express.bodyParser()); }); app.post('/event', function (req, res) {  var events = req.body; events.forEach(function (event) { // Here, you now have each event and can process them how you like processEvent(event); }); }); var server = app.listen(app.get('port'), function() { console.log('Listening on port %d', server.address().port); }); ``` ================================================ FILE: content/docs/for-developers/tracking-events/php-code-example.md ================================================ --- layout: page weight: 10 title: Event Webhook PHP Code Example group: code-examples navigation: show: true --- ## Parse Webhook In this example, we want to parse all emails at *address*@email.sendgrid.biz and post the parsed email to https://sendgrid.com/email.php. Given this scenario, the following are the parameters you would set at the [Parse API settings page](https://sendgrid.com/developer/reply): ``` Hostname: email.sendgrid.biz ``` ``` URL: https://sendgrid.com/email.php ``` To test this scenario, we sent an email to example@example.com and created the following form at https://sendgrid.com/email.php: ```php <?php $to = $_POST["to"]; $from = $_POST["from"]; $body = $_POST["text"]; $subject = $_POST["subject"]; $num_attachments = $_POST["attachments"]; if($num_attachments){ for($i = 1; $i <= $num_attachments; $i++) { $attachment = $_FILES['attachment' . $i]; // $attachment will have all the parameters expected in a the PHP $_FILES object // http://www.php.net/manual/en/features.file-upload.post-method.php#example-369 } } ?> ``` ## Event Webhook To use the Event Webhook, you must first [setup Event Notification]({{root_url}}/for-developers/tracking-events/event/#setup). In this scenario, we assume you've set the Event Notification URL to go the endpoint `/parse.php` on your server. Given this scenario the following code will allow you to process events: ```php <?php $data = file_get_contents("php://input"); $events = json_decode($data, true); foreach ($events as $event) { // Here, you now have each event and can process them how you like process_event($event); } ``` ================================================ FILE: content/docs/for-developers/tracking-events/python-code-example.md ================================================ --- layout: page weight: 10 title: Event Webhook Python Code Example group: code-examples navigation: show: true --- ## Parse Webhook <call-out> We recommend using our official Python SDK, our client library with full documentation, when integrating with <a href="https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound">SendGrid's Inbound Parse Webhook</a>. </call-out> In this example, we want to parse all emails at *address*@email.sendgrid.biz and post the parsed email to http://sendgrid.biz/parse. In this example we will be using Python the Flask framework. Given this scenario, the following are the parameters you would set at the [Parse API settings page](https://sendgrid.com/developer/reply): ``` Hostname: email.sendgrid.biz ``` ``` URL: http://sendgrid.biz/parse ``` To test this scenario, we sent an email to example@example.com and created the following code: ```python from flask import Flask, request import simplejson app = Flask(__name__) @app.route('/parse', methods=['POST']) def sendgrid_parser(): # Consume the entire email envelope = simplejson.loads(request.form.get('envelope')) # Get some header information to_address = envelope['to'][0] from_address = envelope['from'] # Now, onto the body text = request.form.get('text') html = request.form.get('html') subject = request.form.get('subject') # Process the attachements, if any num_attachments = int(request.form.get('attachments', 0)) attachments = [] if num_attachments > 0: for num in range(1, (num_attachments + 1)): attachment = request.files.get(('attachment%d' % num)) attachments.append(attachment.read()) # attachment will have all the parameters expected in a Flask file upload return "OK" if __name__ == '__main__': app.run(debug=True) ``` ================================================ FILE: content/docs/for-developers/tracking-events/segment-sendgrid-source.md ================================================ --- layout: page weight: 100 title: SendGrid Source group: partners seo: description: Learn how to integrate your SendGrid account with Segment. navigation: show: true --- By using [SendGrid Source](https://segment.com/sources/sendgrid/?utm_medium=docs&utm_source=stripe&utm_campaign=sources) with your SendGrid data in your data warehouse, you’ll be able to analyze your email activity (opens, clicks, deliveries, and bounces), lists, and recipients via SQL. Additionally, you can join your SendGrid data with Segment event and other source data you’re already sending to your warehouse, so you can correlate product feature usage with email activity, or tie referral sources into your customer journey analysis. This documentation is managed by [Segment](https://segment.com/?utm_medium=docs&utm_source=sendgrid&utm_campaign=sources). If you have any questions please contact Segment's support team at friends@segment.com. ## Getting Started 1. Create a Segment [account](https://segment.com/sources/sendgrid) 2. Add SendGrid in the “Cloud Apps” Category and enter your credentials 3. Setup a warehouse by bringing your own or having Segment setup and host 4. Give the Source a nickname and schema name. _We recommend sticking to something that reflects the source itself, like `SendGrid` for nickname and `sendgrid` or `sendgrid_prod` for the schema name._ 5. You’ll soon see SendGrid data in your data warehouse Note that you can add multiple instances if you have multiple SendGrid accounts. That’s why we allow you to customize the source’s nickname and schema name! In order to pull information about your contacts, we’ll make requests to SendGrid’s API with our [sync component](#sync). So the first step in setting up the integration is to retrieve your API Keys and drop them into the Segment interface. You can create an API Key by navigating to **Settings > API Keys**, clicking **General API Key**. We recommend providing read permissions for **Email Activity** and **Marketing Activity**. Finally, copy the resulting API Key into the Segment interface, taking care to trim any errant trailing spaces from copying and pasting, and press connect. In the next step, copy the auto-generated Webhook URL and paste it into SendGrid’s Event Notification settings pane under **Settings > Mail Settings**. Once you enable the Event Notification, you’re good to go! Press **Next**, and then **Finish** to wrap up the setup flow. ### Event URL SendGrid has a single Event URL location. By using the SendGrid source, you will be using your only Event URL location. If you remove a pre-existing URL, then that location will no longer receive events. ## Components ### Sync SendGrid has a sync component, which means we’ll make requests to their API on your behalf on a 3-hour interval to pull the latest data into Segment. In the initial sync, we’ll grab all the SendGrid objects (and their corresponding properties) according to the [Collections Table]() below. SendGrid objects will be written into a separate schema, corresponding to the source instance’s schema name you designated upon creation. Our sync component gets resources from SendGrid and forwards them to Segment using an upsert API, so the dimensional data in your warehouse loaded will reflect the latest state of the corresponding resource in SendGrid. For example, if `lists.recipient_count` goes from `100` to `200` between syncs, on its next flush to your warehouse, that tickets status will be `200`. ### Streaming The SendGrid source also has a streaming component which listens in real time for inbound webhooks from SendGrid’s Event Notifications and batches the events to be uploaded on your next warehouse flush. These events are only ever appended to your warehouse. At present, there is no way to retrieve email event history from SendGrid, so you will only have access to data that we’ve collected after you successfully enable this component of the source integration. ## Collections Collections are the groupings of resources we pull from your source. In your warehouse, each collection gets its own table. **Object** collections are updated with each sync. These are pulled via our sync component. **Event** collections are append-only, represent a user action or activity, and may be likened to fact tables in a traditional data warehouse. For a complete visual breakdown of the SendGrid collections and all their properties, [view the Visual Schema here](https://www.lucidchart.com/invitations/accept/c639887d-09da-4f91-a846-1409f6dd0d56). <div class="table-wrap"> | Collection | Type | Description | | ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | activity | Event | The union of all SendGrid **event** tables. Useful for creating funnels | | \_open | Event | Recipient has opened the HTML message. You need to enable Open Tracking for getting this type of event. | | click | Event | Recipient clicked on a link within the message. You need to enable Click Tracking for getting this type of event. | | bounce | Event | Receiving server could not or would not accept message. | | delivered | Event | Message has been successfully delivered to the receiving server. | | processed | Event | Triggered when the email is processed | | dropped | Event | You may see the following drop reasons: Invalid SMTPAPI header, Spam Content (if spam checker app enabled), Unsubscribed Address, Bounced Address, Spam Reporting Address, Invalid, Recipient List over Package Quota | | deferred | Event | Recipient’s email server temporarily rejected message. | | unsubscribe | Event | Recipient clicked on message’s subscription management link. You need to enable Subscription Tracking for getting this type of event. | | spam_report | Event | Recipient marked message as spam. | | lists | Object | [Groups of contacts](https://sendgrid.api-docs.io/v3.0/contacts). | | segments | Object | [Slices of lists](https://sendgrid.api-docs.io/v3.0/contacts). | | recipients | Object | All contacts who have received an email, with information about their past activities and custom activities. [More Info](https://sendgrid.api-docs.io/v3.0/contacts) | </div> ================================================ FILE: content/docs/for-developers/tracking-events/troubleshooting.md ================================================ --- seo: title: Troubleshooting the Event Webhook description: Tips and tricks to troubleshoot your SendGrid Event Webhook, including common issues. keywords: event webhook, troubleshooting, events, duplication, load handling, duplicate events title: Troubleshooting the Event Webhook group: reference-troubleshooting weight: 80 layout: page navigation: show: true --- ## General troubleshooting *Considerations for troubleshooting your Event Webhook instance:* - Start by making sure your web server is returning a 2xx response to our servers. Any other response type will result in our server retrying a POST until we receive a 2xx response or the maximum time has expired. All events are retried at increasing intervals for up to 24 hours after the event occurs. - Next, make sure you are not blocking our IPs that are trying to POST to your server. Our IPs change often since we constantly add more machines. - http://httpresponder.com/ is a helpful tool for debugging webhooks. - You can use the **Test Your Integration** feature within the Event Notification Setting on the [Settings > Mail Settings](https://app.sendgrid.com/settings/mail_settings) page in the [SendGrid UI](https://app.sendgrid.com) to send simulated events to your callback URL. This will not work if you have basic authentication set in your endpoint URL. You can also send a POST from a shell using cURL - this will give you the full response your server is returning including the HTTP headers: ```bash curl -X POST -H "Content-Type: application/json" -d '[{"email":"john.doe@sendgrid.com","timestamp":1337197600,"smtp-id":"<4FB4041F.6080505@sendgrid.com>","event":"processed"},{"email":"john.doe@sendgrid.com","timestamp":1337966815,"category":"newuser","event":"click","url":"https://sendgrid.com"},{"email":"john.doe@sendgrid.com","timestamp":1337969592,"smtp-id":"<20120525181309.C1A9B40405B3@Example-Mac.local>","event":"processed"}]' ``` - If you're not getting a response from your server, follow the steps in [Getting started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) to test your SendGrid instance with Webhook tester. You could also use tools like ngrok, or Runscope. ## Common issues ### Duplicate events **It is possible to see duplicate events in the data posted by the Event Webhook.** We recommend that you use some form of deduplication when processing or storing your Event Webhook data using the `sg_event_id` as a differentiator since this ID is unique for every event where `sg_event_id` is present. The `sg_event_id` is a string up to 100 characters that is `Base64url` encoded. ## Additional Resources - [Getting started with the Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) - [Event webhook reference]({{root_url}}/for-developers/tracking-events/event/) - [An Event Webhook case study](https://sendgrid.com/blog/leveraging-sendgrids-event-api/) - [Webhook web libraries]({{root_url}}/for-developers/sending-email/libraries/) - [Getting Started with Keen](https://keen.io/guides/getting-started/) ================================================ FILE: content/docs/glossary/7-bit-encoding.md ================================================ --- seo: title: ASCII Encoding description: 7 bit encoding is the same as ASCII encoding, which is used for storing letters in binary. keywords: title: 7 Bit Encoding weight: 0 layout: page navigation: show: false --- 7 bit encoding is a reference to the ASCII character set, which is a set of 128 English alphabet characters and is used to store letters in binary. The set includes all the English lowercase letters, uppercase letters, and numbers from 0 to 9. The reason for the characters to be encoded to 7-bits, is because early computers handled data in bytes, or 8 bits. The extra bit was originally reserved for error checking. In this encoding we get 7 digit representations in 0s and 1s for each of the English letters we are trying to transmit. SendGrid requires 7 bit encoding in our [SMTPAPI categories header]({{root_url}}/for-developers/sending-email/categories/). For more information, visit Wikipedia for the entire [history of ASCII](http://en.wikipedia.org/wiki/ASCII). ================================================ FILE: content/docs/glossary/a-record.md ================================================ --- seo: title: A Record description: The A record links an IP address to a domain keywords: A record, DNS, domain, IP address, Domain Name Service title: A Record weight: 0 layout: page navigation: show: false --- The A record (address record) links your dedicated IP address to your chosen domain. It does this by mapping your domain to your IP address through records that you export from SendGrid and upload into your DNS host. If your domain+ subdomain is `marketing.example.com`, and your dedicated IP address is `101.10.10.101`, setting up the SendGrid A record links your domain with your dedicated IP address - so anything sent over your domain associates with your dedicated IP, and anything sent over your dedicated IP associates with your domain. ================================================ FILE: content/docs/glossary/account-reputation-dashboard.md ================================================ --- seo: title: Account Reputation Dashboard description: We base your email monitoring reputation on your bounces, blocks, spam, invalid email, and successfully delivered emails. keywords: reputation, email sender reputation, email reputation monitoring title: Reputation Monitoring weight: 0 layout: page navigation: show: false --- Once logged in to your account, on the left side of your [SendGrid.com](https://sendgrid.com) dashboard, you can find your **SendGrid account reputation**. It's your IP reputation score, which will be somewhere from 0% to 100%. This score will go up or down based on your [bounce]({{root_url}}/glossary/bounces/), [block]({{root_url}}/glossary/blocks/), [spam]({{root_url}}/glossary/spam-reports/) and invalid rates. In other words, this reputation is an indicator of how we view your email sending practices. ![Reputation Monitoring]({{root_url}}/images/Screen_Shot_2015-05-20_at_3.32.24_PM.png "Reputation indicator") It is important to monitor your global statistics on a daily basis to make sure you keep your IP reputation score high to avoid getting on [deny list]({{root_url}}/glossary/deny-list/). <call-out> Please note that the SendGrid Reputation does not represent your inboxing percentage at mailbox providers. </call-out> **How is the SendGrid Reputation Calculated?** The SendGrid account reputation is computed based on a calculation of: - The percentage of delivered requests out of the total amount requested (delivered / requests). This number takes into account bounces, invalid emails, and drops (repeat bounces, unsubscribes, etc.). Please review our [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) article for more detail on these terms. - Spam Reports. Each spam report is a user actively rejecting your mail and has a strong negative effect. <call-out> You can increase the SendGrid reputation score by removing unengaged users and [dropped addresses]({{root_url}}/glossary/drops/) from your lists before sending. Also be sure you are only sending to users who have opted in to receive your email to help prevent spam reports. </call-out> **The Effect of Reputation on your Account** The significance of your reputation depends on the plan you chose when creating your SendGrid account. For all plans, if your reputation becomes low enough, our Compliance team may mark your account as "under review" and contact you. If you're using a Free or Essentials plan, we will put your account in a "New" IP cluster initially while we learn your sending habits. After that, you're placed in an IP cluster with other customers with the same reputation range as you. IP clusters keep the good senders together and prevents the poorer senders from harming the good ones. If you're a Pro plan or higher, you instead send from a dedicated IP, and our internal reputation metric does not have as much weight. Alternatively, you should keep a closer eye on your _domain reputation_. Domain Reputation is an essential part of how mailbox providers decide whether or not your email lands in the spam folder or the inbox. <call-out> Learn more about [Domain Reputation, and why it's important.](https://sendgrid.com/blog/what-is-a-domain-reputation/) </call-out> **SendGrid's Reputation Policy** We regularly monitor our customers' account reputation for abuse and undesirable sending practices. Our general guidelines for account reputation take into account the following reputation thresholds: - **Reputation above 80%:** Nice! This percentage indicates a good sending reputation, and there are no issues at this time. - **Reputation between 70% and 80%:** This is considered a poor reputation and you should consider taking action to identify and fix problems with your sending practices. - **Reputation below 70%:** Accounts with a reputation below 70% may be subject to immediate suspension or termination. <call-out-link linktext="EXPERT SERVICES" img="/img/expert-insights-promo3.png" link="https://sendgrid.com/solutions/expert-services/"> ### Need a helping hand? Getting into the inbox just so you can have the chance to engage with your customers often isn’t as easy as pressing “send.” Get customized advice from our team of email experts on how to optimize your email strategy. </call-out-link> ================================================ FILE: content/docs/glossary/ad-exchange.md ================================================ --- layout: page weight: 0 title: Ad Exchange group: glossary seo: title: Ad Exchange description: Definition of an Ad Exchange keywords: navigation: show: true --- ## Ad Exchange An ad exchange is a place where advertisers and publishers can buy and sell display, video, and mobile ads through a digital marketplace. ================================================ FILE: content/docs/glossary/ad-impression.md ================================================ --- layout: page weight: 0 title: Ad Impression group: glossary seo: title: Ad Impression description: Definition of an Ad Impression keywords: navigation: show: true --- ## Ad Impression At the moment in which an ad is displayed on a web page, it is called an impression. ================================================ FILE: content/docs/glossary/ad-unit.md ================================================ --- layout: page weight: 0 title: Ad Unit group: glossary seo: title: Ad Unit description: Definition of an Ad Unit keywords: navigation: show: true --- ## Ad Unit The ad unit is the container that holds the advertising copy and graphics for a digital advertisement. ================================================ FILE: content/docs/glossary/affiliate-marketing.md ================================================ --- layout: page weight: 0 title: Affiliate Marketing group: glossary seo: title: Affiliate Marketing description: Definition of Affiliate Marketing keywords: navigation: show: true --- ## Affiliate Marketing Companies will offer to pay individuals or companies (i.e., affiliates) to promote their products or services in exchange for a commission. This is referred to as affiliate marketing. ================================================ FILE: content/docs/glossary/allow-list.md ================================================ --- seo: title: Allow list description: Allow listing refers to granting IPs access to a server or system. keywords: allow list, IP, access, management title: Allow list weight: 0 layout: page navigation: show: false --- Allow listing (some services use the term, "whitelisting") refers to the process of granting a specific IP address access to a server or system. SendGrid's [IP Access Management]({{root_url}}/ui/account-and-settings/ip-access-management/) is one example of allow listing. IP Access Management is a security feature that allows you to control who can access your SendGrid account based on their IP address. You may also hear the term _allow list_ when referring to a list of IP addresses that receive special treatment when sending mail to a specific inbox provider. Email allow lists are becoming less and less common. These days, the best way to ensure your messages land in the inbox is to send mail that you know your recipients will love. For more information on deliverability best practices, please visit our [Deliverability Overview]({{root_url}}/ui/sending-email/deliverability/) ================================================ FILE: content/docs/glossary/automated-email.md ================================================ --- layout: page weight: 0 title: Automated Email navigation: show: false seo: title: Automated Email override: true description: Automated Email allows you to dynamically send relevant content to individual recipients. keywords: triggered email, automated email, behavior-driven email --- Automated email, also known as [triggered email]({{root_url}}/glossary/triggered-email/) or behavior-driven email is sent when a specific [triggering event]({{root_url}}/glossary/triggered-actions/) occurs or a specific user takes an action that prompts the delivery of the email. While traditional marketing email involves sender-initiated promotional messages sent to a list of recipients, automated email is initiated by user behavior, allowing you to dynamically send targeted, real-time promotional content that is uniquely relevant to an individual recipient. Examples of email automation include a welcome series [drip campaign]({{root_url}}/glossary/drip-campaign/) that is initiated by a new user sign-up or a win-back campaign to re-engage a lapsed user. The ability to send very relevant, timely emails directed to individual recipients makes automated email a uniquely powerful tool for building and nurturing customer relationships, enhancing the image of your brand, and increasing customer engagement. <call-out> Interested in sending automated email? SendGrid provides [Marketing Campaigns Automation (click here to see more)](https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/). This is available for packages using an ["Advanced" Marketing Campaigns plan](https://sendgrid.com/pricing/). </call-out> ================================================ FILE: content/docs/glossary/autoresponder.md ================================================ --- seo: title: Autoresponder description: Autoresponders generate email responses to actions and events. keywords: automated email title: Autoresponder weight: 0 layout: page navigation: show: false --- An autoresponder is a computer program that generates a response to an email, request, or action. Autoresponders were initially used to notify a sender of an undeliverable email, but now they are often used in email marketing. Autoresponders can give you the ability to send a customer a pre-written email when a specified event takes place, such as a customer creating an account or purchasing a product. - Autoresponders can be outsourced to an **Application Service Provider** that provides the infrastructure and support for the autoresponder. - Autoresponders can also be **installed server-side**, giving you complete control while requiring you to provide the infrastructure and technical skill to maintain the autoresponder. <call-out> You can set up an autoresponder with SendGrid, by utilizing the [Inbound Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) and the [v3 Mail Send endpoint](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send). </call-out> More information about autoresponders can be found [here](https://en.wikipedia.org/wiki/Autoresponder). ================================================ FILE: content/docs/glossary/bayesian-filter.md ================================================ --- seo: title: Bayesian Filter description: Bayesian Filtering is a technique for detecting spam. keywords: Bayesian Filter, spam title: Bayesian Filter weight: 0 layout: page navigation: show: false --- <call-out> If you discover spam that was sent by a SendGrid customer, please [report it to our team](https://sendgrid.com/report-spam/). We appreciate your help in keeping our email stream clean. </call-out> This is a statistical method for determining the probability that an email is spam by looking for the use of words or phrases commonly associated with spam email. A Bayesian filter detects spam by comparing the words or phrases within the questionable email to a set of known words or phrases associated with spam. Bayesian filtering has a very low rate of false positives and is a tried and true method for filtering spam. For more information about Bayesian filtering, refer to this Wiki: [Naive Bayes spam filtering](https://en.wikipedia.org/wiki/Naive_Bayes_spam_filtering). ## Related Articles - [Spam]({{root_url}}/glossary/spam/) - [Spam Filter]({{root_url}}/glossary/spam-filter/) - [Spam Reports]({{root_url}}/glossary/spam-reports/) - [Spam Trap]({{root_url}}/glossary/spam-traps/) ================================================ FILE: content/docs/glossary/blocks.md ================================================ --- seo: title: Blocks description: Blocked emails happen when your IP address has been added to a deny list or has been blocked by an ISP or messaging organization. keywords: blocks, undelivered email title: Blocks weight: 0 layout: page navigation: show: false --- Blocked messages appear under Email Reports under Blocks. When your IP address has been added to a deny list, or has been blocked by an ISP or messaging organization, the affected email shows up on this list. Typically it is possible to have your IP address removed from a block list, and some lists automatically do this after a period of time. Blocks are less permanent than Bounces. This is a list of refused messages that were either blocked by an ISP or deferred longer than 72 hours. In addition, SendGrid does not treat the blocks list as a suppression list - subsequent sends to emails on this list will be sent like normal. Having an entry on the SendGrid block list does not automatically drop email as it does for the bounce and unsubscribe list. See the block reason column for more detail specific to the blocked email. ![Blocks]({{root_url}}/images/blocks_1.png) <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ## Additional Resources: * [Web API & Blocks](https://sendgrid.api-docs.io/v3.0/blocks-api/retrieve-all-blocks) ================================================ FILE: content/docs/glossary/bounces.md ================================================ --- seo: title: Bounces description: Bounced emails are emails that are returned to the server that sent them. keywords: bounced email, bounces, undelivered email, returned email, rejected email title: Bounces weight: 0 layout: page navigation: show: false --- A bounce is a message that is returned to the server that sent it. Bounced emails are either a permanent failure to deliver the email or a temporary failure to deliver the email, based on conditions with the recipient mail server. Hard Bounces - A hard bounce is an email message that has been returned to the sender because the recipient's address is invalid. A hard bounce might occur because the domain name doesn't exist or because the recipient is unknown. If an email is on the bounce list, we will auto drop any future requests to this email address. Soft Bounces - A soft bounce is an email message that gets as far as the recipient's mail server but is bounced back undelivered before it gets to the intended recipient. A soft bounce might occur because the recipient's inbox is full. If you want to receive notification of bounces in your application, you can enable the Real-time Event Notification API and SendGrid will alert your application of any bounces, clicks, opens, or otherwise that happen to the emails you send. Alternatively, you can enable Bounce Forwarding within your account to receive an email each time a bounce occurs. You can also [retrieve and edit your list of bounces](https://sendgrid.api-docs.io/v3.0/bounces-api/retrieve-all-bounces) through our Web API. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ### Additional Resources: * [Bounce Forwarding]({{root_url}}/ui/sending-email/bounces/) * [Email Activity & Bounces]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) ================================================ FILE: content/docs/glossary/bulk-email-service.md ================================================ --- seo: title: Bulk Email Service description: Bulk email service is a way to send an email, or multiple emails, to a large list of various recipients. keywords: bulk email service title: Bulk Email Service weight: 0 layout: page navigation: show: false --- A bulk email service allows you to send email communications to large lists of multiple recipients by incorporating email into your applications. You can send one email to many people, or a unique email to each person on your list with a bulk email service. Depending on the provider, you can send unique emails to each recipient by providing a template for substituting information (such as a name). Commonly, bulk email is used for newsletters or marketing email. If you have a list of customers or prospects, you can send them content relevant to their business or interest, from a single application. A bulk email service allows you to send to any list, regardless of its size. The frequency at which you send is entirely up to you, and should be based on what the recipients expect. Your engagement data, including spam reports, unsubscribes, and open and click rates, will tell you whether your message is hitting the mark. SendGrid is a bulk email service for both marketing email and transactional email (single emails triggered by actions within your application). SendGrid's [bulk transactional email pricing](https://sendgrid.com/pricing?mc=SendGrid%20Documentation) and [bulk email marketing pricing](https://sendgrid.com/pricing?mc=SendGrid%20Documentation) are based on the volume of email you send, not the size of your list. SendGrid provides valuable insights across your entire email program: * Deliverability rate to ensure your email is getting to the recipient's server * Open and click tracking to measure engagement * Webhook to notify your application of bounces, unsubscribes, and spam reports The bulk email service can be enabled with minimal changes to your application. At the basic level, simply point your SMTP settings to our server and SendGrid will take care of the rest. You can also use our Web API or SMTP API to more deeply integrate into your system. The marketing email service allows non-technical users to send bulk newsletters and other bulk emails using a drag-and-drop interface. List management and all aspects of the service are also available via the marketing service API, so developers can connect email to your company's workflow. ================================================ FILE: content/docs/glossary/bulk-mail-folder.md ================================================ --- seo: title: Spam Folder description: Bulk Mail folder is also called “spam” or “junk” folder, the folder where questionable email is routed. keywords: bulk mail folder, spam, junk title: Bulk Mail Folder weight: 0 layout: page navigation: show: false --- The Bulk Mail Folder is also called the “spam” or “junk” folder, the folder where questionable email is routed. There are many factors which determine whether or not a message lands in the Bulk Mail Folder. Each receiving mail server will use its own criteria to determine the quality of each message it receives. SendGrid offers many [best practices]({{root_url}}/ui/sending-email/deliverability/) to help ensure your message lands appropriately in the inbox. Keep your emails out of the Junk folder by learning more about email deliverability. ================================================ FILE: content/docs/glossary/campaigns.md ================================================ --- seo: title: Campaigns description: Campaigns are used to send custom emails to targeted recipient segments. keywords: campaigns title: Campaigns weight: 0 layout: page navigation: show: false --- [Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) are used to send custom email templates to targeted recipient segments. In utilizing the Marketing Campaigns UI or API, one can create a sender identity, upload contacts, set up unsubscribe groups, edit email templates, and create a campaign to send specifically tailored email to different email group segments and boost your email marketing. ================================================ FILE: content/docs/glossary/can-spam.md ================================================ --- layout: page weight: 0 title: CAN-SPAM navigation: show: false seo: title: CAN-SPAM override: true description: The CAN-SPAM Act lists the guidelines, requirements, and penalties regarding the sending of commercial bulk email. --- The [CAN-SPAM Act of 2003](https://www.ftc.gov/tips-advice/business-center/guidance/can-spam-act-compliance-guide-business) lists the guidelines, requirements, and potential penalties for noncompliance regarding the commercial use of email and the legal rights of recipients of commercial email. CAN-SPAM provides several requirements for commercial senders including, but not limited to: - Senders may not use false or misleading headers. - Senders may not use deceptive subject lines. - Senders must give their recipients the option of opting out of commercial email. - Senders must honor all opt-out requests. This is by no means a complete description of CAN-SPAM, please visit the [CAN-SPAM Act Compliance Guide](https://www.ftc.gov/tips-advice/business-center/guidance/can-spam-act-compliance-guide-business) for more information. <call-out> The guidelines laid out in CAN-SPAM represent the “bare-minimum” regarding sending practices. Following these guidelines does not guarantee delivery to your recipients’ inboxes: CAN-SPAM leaves a considerable amount of room for improvement. Please visit [SendGrid Deliverability Tips and Tricks]({{root_url}}/ui/sending-email/deliverability/) for a more detailed discussion of how you can improve your sending practices. </call-out> <call-out type="warning"> CAN-SPAM is not limited to bulk email. Any commercial email communication, including business-to-business and business-to-customer email, is covered by the CAN-SPAM Act. </call-out> ================================================ FILE: content/docs/glossary/categories.md ================================================ --- layout: page weight: 0 title: Categories navigation: show: false seo: title: Categories override: true description: Paying attention to your deliverability metrics can help optimize your delivery rate and reduce the risk of being seen as a spammer. --- Categories help organize your email analytics by enabling you to tag emails you send by topics you define. <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Just as you can view the statistics on all your activity under the '[Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview)' tab, you can go a step further and view the [statistics broken down to a particular category]({{root_url}}/ui/analytics-and-reporting/categories/). The events that can be associated with category include: - Emails sent - Clicks - Emails opened - Emails bounced - Spam Reports - Unsubscribes The actual statistics included vary depending upon the set of enabled apps. Emails sent, bounces, and spam reports will always get tracked. [Unsubscribes]({{root_url}}/ui/sending-email/subscription-tracking/), [Clicks]({{root_url}}/ui/account-and-settings/tracking/#click-tracking), and Opens require that the associated Setting is enabled. Check out [Settings](https://app.sendgrid.com/settings) to see which apps you have enabled. In order to add the X-SMTPAPI categories header, please look at our [SMTP API Categories]({{root_url}}/for-developers/sending-email/categories/) documentation. You can also get a [full category list]({{root_url}}/for-developers/sending-email/categories#get) or get [category specific statistics](https://sendgrid.api-docs.io/v3.0/categories/retrieve-email-statistics-for-categories) from the SendGrid API. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/challenge-response.md ================================================ --- seo: title: Challenge Response description: An automated reply to a sender to filter out spammers. keywords: reply, verified sender, email filter title: Challenge Response weight: 0 layout: page navigation: show: false --- A challenge–response (C/R) system is a type of filter that automatically sends a reply back with a request to the sender of an incoming email. In the reply, the sender is asked to perform an action to ensure delivery of the original message. The action to be performed is easy to do if you’re an individual, but requires a lot effort if performed in large numbers, in this way effectively filtering out spammers. A good example of this is a verification email where you need to click a link to verify your email address to be activated within a new system. This is important with an email system to verify that you are opting in to a system and to make sure that you’re not a spammer. ================================================ FILE: content/docs/glossary/clicks.md ================================================ --- layout: page weight: 0 title: Clicks and Unique Clicks navigation: show: false seo: title: Clicks and Unique Clicks override: true description: Track the links your customers click from your emails with SendGrid. --- SendGrid can replace the links in your email templates with a custom link that when clicked, will redirect your customers to the original link from your template. When the user clicks, SendGrid will record the click event. SendGrid can track 1000 link clicks per email. In [Statistics]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/), The “Clicks” percentage is the total number of times your users have clicked on the various links within your emails, divided by the total number of Delivered messages. The “Unique clicks” percentage is the number of unique individuals that have clicked the links in your emails, divided by the total number of Delivered messages. This statistic requires that the Click Tracking feature be enabled under your Tracking Settings. Users clicking a SendGrid Unsubscribe link will not count as a Click. However, if you use a third-party unsubscribe link, it will be tracked as a Click. <call-out> SendGrid will store tracking data for unique click events for up to 7 days. </call-out> <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/cname.md ================================================ --- layout: page weight: 0 title: CNAME seo: title: CNAME override: true description: The CNAME record creates an alias for subdomain.yourdomain.com and points it to another domain navigation: show: false --- The CNAME record (canonical name record) creates an alias for subdomain.yourdomain.com and points to sendgrid.net. The CNAME is needed for our click and open tracking features in order for those statistics to be routed back to your SendGrid account. This is also what your messages will be signed by, so your recipients will be able see your CNAME. What it should look like: ``` subdomain.yourdomain.com. | CNAME | sendgrid.net. ``` If your account has a dedicated IP and you are looking to set up [reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) for your IP, you will need to add some records to your DNS host. In this group of records you will have 1 CNAME record. If you are having trouble validating your CNAME record, please see our [sender authentication troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/). ================================================ FILE: content/docs/glossary/complaint.md ================================================ --- seo: title: Complaint description: When an email recipient identifies an email message as spam or junk by clicking the “report spam” or “mark as junk” button within their email reader. keywords: complaint, spam, junk title: Complaint weight: 0 layout: page navigation: show: false --- A complaint is when an email recipient identifies an email message as spam or junk by clicking the “report spam” or “mark as junk” button within their email reader. A sender’s complaint rate is calculated by dividing the total number of emails received by the ISP by the number of complaints reported by that ISP’s customers. Higher numbers of complaints can negatively impact your [email deliverability]({{root_url}}/glossary/deliverability/). To get more information please check out our [Email Infrastructure Guide.](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/ctr.md ================================================ --- seo: title: Click-Through Rate (CTR) description: What is CTR? keywords: CTR, click, rate, tctr, clicks, through title: Click-Through Rate (CTR) weight: 0 layout: page navigation: show: false --- ## What is CTR? CTR stands for "click-through rate". CTR is a metric that's used to measure the success of an email campaign. Click-through rates are expressed as a percentage, which SendGrid calculates by taking the number of unique clicks divided by the number of unique opens from an email campaign multiplied by 100. For example: Let's say that you send out a marketing campaign to 1000 recipients, and of those 1000 messages you register 300 unique opens. Then, out of those 300 unique opens, you record 100 unique clicks. This would give your campaign a click-through rate of 33.3%, since 100 clicks divided by 300 opens equals 0.333 multiplied by 100. ## TCTR SendGrid has also added total click-through rate (TCTR) as a metric for marketing emails, which is expressed as the total number of clicks divided by the total number of opens. A higher TCTR means that more of your recipients have opened and clicked through your messages more than once. ## Why is CTR important? Click-through rates help determine the relative success or failure of an email campaign based on the engagement of your recipients. The higher the click-through rate, the more successful an email campaign is considered to be. However, there is no standard value for what constitutes an ideal click-through rate because there are many different factors that can affect the click-through rate of an email such as the type of email being sent, the sending frequency, your company's industry, and even the time of day. ## My CTR seems low, what can I do to change that? As mentioned before, click-through rates can vary between campaigns depending on a lot of different factors; however, the three most significant aspects that affect click-through rates are message content, sending frequency, and overall consistency. ### Message Content Make sure that the content of your emails is to the point and relevant to your subject line. Keep your paragraphs short whenever possible, ideally no more than 3 to 4 concise sentences. Do not use images frivolously. You should try to convey your updates primarily through text, as too many images in an email body can make a message take longer to load and/or might make it look suspicious at a first glance (since many email clients do not load images within messages by default). ### Sending Frequency Be up front with your recipients regarding your sending rates. If you tell your users that you will send out one newsletter every week, then it's important to stick to that schedule. Better still, give your recipients options, such as the ability to choose between a weekly and a monthly newsletter. ### Consistency Ensure that all of your emails are consistent. If you decide to pick a common theme, color, or font style, then you should use it across all of your campaigns so that your recipients know what to expect from you. It's also important to keep the information within your messages relevant to your company and your industry. Remember, email marketing is not an exact science. Since there is no average value to shoot for, CTRs can vary wildly between companies and across industries, so it's best to keep an eye on your email campaigns and adjust your messages and sending practices accordingly. Find information about the [best sending practices](http://sendgrid.com/blog/best-practices/ "Link: http://sendgrid.com/blog/best-practices/") and more details on how to improve your [deliverability](http://sendgrid.com/blog/deliverability/ "Link: http://sendgrid.com/blog/deliverability/") over on our [blog](http://sendgrid.com/blog/). <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/custom-fields.md ================================================ --- seo: title: Custom Fields description: Custom fields allow you add extra information about your contacts to your contact database. keywords: title: Custom Fields weight: 0 layout: page navigation: show: false --- [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) allow you to add extra information about your contacts to your contact database. With custom fields, you can create custom segments from your individual contacts or from your contact database that will dynamically update your content with the values for the individual contact receiving the email. Your custom fields are completely customizable to the use cases and user information that you need. For more information about Custom Fields, please see our [documentation]({{root_url}}/ui/managing-contacts/custom-fields/). ================================================ FILE: content/docs/glossary/deferrals.md ================================================ --- seo: title: Deferral title: Deferral weight: 0 layout: page navigation: show: false --- A deferred status can occur when an ISP or mailbox provider is for some reason not ready to accept email from your IP address. Instead of blocking or bouncing the message, the provider will defer or temporarily delay receiving the message and wait for the email to be resent. There are several reasons a provider will give this feedback. Some common reasons are that the provider does not recognize the IP from which a message originates; or it could just be that their system is operating in such a way that they cannot accept the email at that specific time. If, upon your resending, the provider determines that it is ready to trust you as a sender or their system operations are back to normal, the email will be accepted. SendGrid will retry delivery of a deferred email on behalf of our customers for 72 hours from the time of the first deferral, after which time the email address will be placed on the Block Suppression list. If you have built your own email solution, you will want to build this intelligence into your code in order to avoid having to retry deliveries manually. ================================================ FILE: content/docs/glossary/deliverability.md ================================================ --- seo: title: Deliverability description: Email deliverability is a critical component for all email communication with customers. Strong deliverability is a necessity for any web application. keywords: email deliverability title: Deliverability weight: 0 layout: page navigation: show: false --- Deliverability represents your sent emails being delivered to your recipient’s inbox as intended. Strong deliverability is critical for any company, as email is the primary method of communication to customers. Your delivery rate is the total number of emails successfully delivered to the ISPs divided by the total number of emails sent. The higher your delivery rate and the more emails that make it to the inbox, the better the response will be to your messages. Whether you drive revenue from email, or have goals for new user acquisition, engagement, or customer retention, paying close attention to your email deliverability is key. Good email deliverability is influenced by a lot of factors, including having a good sending reputation, signing your mail, keeping clean lists, sending wanted content, and much more. There are some standard email deliverability best practices that you should follow to make sure that your emails reach the inbox. These include: * Building your sender reputation * Securing your infrastructure * Authenticating your mail streams * Monitoring your sending data * Sending wanted mail SendGrid helps you [achieve strong email deliverability](https://sendgrid.com/solutions) by providing these services: * Reputation monitoring * ISP monitoring * ISP Outreach * SPF and DKIM * Spam Filter Testing * Dedicated IP Addresses * Bulk Sender Notification * Feedback Loops * Real-time analytics * Open and click tracking SendGrid also has a world-class support team that is available 24/7 via chat, phone, and email to address any of your email deliverability needs. If email drives your business, then paying close attention to your email deliverability rates is an undeniable key to your success. Let SendGrid help you achieve that success. To learn more about how email deliverability affects your business, download our free [Email Deliverability Guide](https://sendgrid.com/marketing/guide-2019-deliverability-guide/). <call-out-link linktext="EXPERT SERVICES" img="/img/expert-insights-promo3.png" link="https://sendgrid.com/solutions/expert-services/"> ================================================ FILE: content/docs/glossary/deliveries.md ================================================ --- seo: title: Delivery description: A delivery is recorded when a request to send an email results in the delivery of that email to the end recipient. keywords: Delivery, email delivery, statistics, email statistics title: Delivery weight: 0 layout: page navigation: show: false --- A delivery is recorded when a request to send an email results in the email being accepted by the receiving server. However, this does not necessarily mean that the message reached the recipient’s inbox. Some users and some email applications may filter the email away from the inbox even though the email was delivered to (read: accepted by) the recipient email server. If an email is indicated as delivered you can be certain that it was not deferred by the ISP. Related to delivery is deliverability, which is the measurement of email that reaches the inbox. So while an email could be "delivered" (i.e. accepted by the recipient email server), 100% "deliverability" would only be achieved if that email was then delivered to the recipient's inbox. Visit [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) to find more information about all the statistics SendGrid provides. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/demand-side-platform.md ================================================ --- layout: page weight: 0 title: Demand-Side Platform (DSP) group: glossary seo: title: Demand-Side Platform (DSP) description: Definition of a Demand-Side Platform (DSP) keywords: navigation: show: true --- ## Demand-Side Platform A demand-side platform or DSP allows advertisers to bid on individual impressions level across multiple ad exchanges in real-time. It is usually more cost effective to purchase ads on a DSP than on an ad exchange. ================================================ FILE: content/docs/glossary/deny-list.md ================================================ --- seo: title: Deny list description: A list of IP addresses that are known to send unsolicited or unwanted emails keywords: email deny list, deny list, spam, unsolicited emails, unwanted emails title: Deny list weight: 0 layout: page navigation: show: false --- A deny list (some services use the term, "blacklist") is a list of IP addresses that have been detected sending unsolicited and unwanted emails. Inbox service providers (like Gmail, Microsoft, Yahoo, and AOL) and enterprises use deny list to identify and filter illegitimate mail streams. Specific sending domains, in addition to sending IPs, can also be added to a deny list. All major ISPs use some form of deny listing service to protect their customers from malicious emails, although the deliverability impact can vary depending on the service that lists the IP. If you find that your IP address is on the deny list of one the many legitimate services, then submit a delisting request. SendGrid keeps a close eye on our IP’s, and we try as quickly as possible to resolve any issues with deny lists. However, getting your IP off the deny list often requires the user sending the mail to contact the ISP. ## Delisting Shared IP Plans When on a Free or Essentials plan, your account is using shared IP pools - you are sharing IP addresses with many other customers, and there is the potential of being adversely affected by senders in the same pool. When one of the shared IP pools is added to a deny list, SendGrid receives an automatic notification and handles the delisting request on behalf of our customers. Removal time varies depending on the list. <call-out> SendGrid is unable to move your account to a new IP pool. The best way to not be impacted by other senders is to get a dedicated IP on a Pro or higher plan. </call-out> ## Delisting Dedicated IP Plans We ask that our dedicated IP plan users make the initial delisting request if they discover their SendGrid IP on a deny list. SendGrid is happy to step in and assist with these delisting requests if the listing service requires the IP administrator to take action, or if the delisting form is too complicated. <call-out> If a sending domain (and not the IP address) is blocked, that domain’s controller is responsible for handling the delisting request. </call-out> ## Checking Your IP Address Here are 2 aggregation websites that anyone can use to check on the status of their IP: - [MulitRBL](http://multirbl.valli.org/) - [MXToolbox](http://www.mxtoolbox.com/blacklists.aspx) ## Delisting Request Forms Below are links to the delisting forms used by the more popular external deny listing services: - [AOL](https://postmaster.aol.com/sa-ticket) - AT&T - *email abuse_rbl@abuse-att.net* - [Barracuda](http://www.barracudacentral.org/rbl/removal-request) - [CASA](http://www.anti-spam.org.cn/?Locale=en_US) - [Comcast](http://postmaster.comcast.net/block-removal-request.html) - [Google](https://support.google.com/mail/contact/msgdelivery) - [Invalument](http://www.invaluement.com/removal/) - [Manitu](http://www.dnsbl.manitu.net/index.php?language=en) - [McAfee](https://www.mcafee.com/enterprise/en-us/threat-center/threat-feedback.html) - [Mimecast](http://www.mimecast.com/senderfeedback) - [Office 365](https://sender.office.com/) - [SORBS](http://www.sorbs.net/) - [SpamCop](https://www.spamcop.net/bl.shtml) - [Spam Rats](http://www.spamrats.com/removal.php) - [Spamhaus](https://www.spamhaus.org/lookup/) - [SURBL](http://www.surbl.org/surbl-analysis) - [Trend Micro](https://www.ers.trendmicro.com/) - [URIBL](https://admin.uribl.com/) - [Yahoo](http://help.yahoo.com/l/us/yahoo/mail/postmaster/bulkv2.html) ## Gmail, Yahoo, Hotmail, and AOL Bulk Email Sender Guidelines - [Gmail Email Sender Guidelines](https://support.google.com/mail/answer/81126) - [Yahoo Email Sender Guidelines](https://help.yahoo.com/kb/mail-for-desktop/SLN3435.html?impressions=true) - [Hotmail/Outlook/Live Bulk Email Sender Guidelines](https://mail.live.com/mail/policies.aspx) - [AOL Bulk Email Sender Guidelines](https://postmaster.aol.com/best-practices) If you are sending mail using these guidelines and still have problems delivering email to those email providers, you can contact the ISP support by the following URL: - [Gmail Bulk Sender Contact Form](https://support.google.com/mail/contact/bulk_send_new?visit_id=1-636427436775630765-3555263264&rd=1) - [Yahoo Bulk Sender Contact Form](http://help.yahoo.com/l/us/yahoo/mail/postmaster/bulkv2.html) - [Hotmail Deliverability Issue Submission](https://mail.live.com/mail/services.aspx) - [AOL Allow Listing Process](https://postmaster.aol.com/whitelist-request) <call-out type="warning"> If a listing service ever asks you pay a fee for a delisting request, or if they say that they do not accept delisting requests, then you should not waste your time or money trying to get your domain/IP delisted because these services are rarely, if ever, used by ISPs. </call-out> <call-out> Looking for customized expert advice to improve your email program? Our team of email experts can help you create a plan to ensure you're optimizing your email delivery and engagement, and avoiding future issues like deny lists. Learn more on our [Expert Services](https://sendgrid.com/solutions/expert-services/) page. </call-out> ================================================ FILE: content/docs/glossary/direct-response-advertising.md ================================================ --- layout: page weight: 0 title: Direct Response Advertising group: glossary seo: title: Direct Response Advertising description: Definition of Direct Response Advertising keywords: navigation: show: true --- ## Direct Response Advertising Direct response is a form of advertising that encourages or prompts viewers of a digital advertisement to take immediate action or engage with the ad directly. For examples, direct response ads will elicit the user to sign up for a mailing list, purchase something, or provide feedback. ================================================ FILE: content/docs/glossary/dkim.md ================================================ --- seo: title: DKIM description: DKIM is an email authentication protocol that helps ISPs better identify legitimate email senders. keywords: dkim, domainkeys identified mail, dkim signature, enable dkim title: DKIM weight: 0 layout: page navigation: show: false --- DomainKeys Identified Mail (DKIM) is a validation method designed to help Internet Service Providers detect and prevent malicious email delivery. Because email has no built-in authentication mechanisms, it’s often spoofed in an attempt to extract information from a message’s recipient. DKIM uses [public-key cryptography](https://www.twilio.com/blog/what-is-public-key-cryptography) to sign [email message headers](/glossary/header/)—optionally, the message body may also be signed. This signature allows receiving email servers to determine whether a message was sent by a domain owner and whether the message was altered in transit. ## How does DKIM Work? DKIM is implemented using a [TXT](https://en.wikipedia.org/wiki/TXT_record) DNS record. The TXT record provides the public key that receiving mail servers use to verify the authenticity of a message. One way to understand the DKIM process is to pretend you’re mixing paint. Your private key contains one mixing color like red. Your public key contains another mixing color like blue and the final mixed color, purple. Let’s say you publish a public key that contains a mixing color, blue, and the final color, purple. Your private key is the color red, but only you know this. When you send a message, it will be signed with the color red. When an email server receives a message from your domain, it will look up your public key and attempt to solve the puzzle. By combining the public mixing color, blue, with the message signature, red, the receiving server can be confident the message is from you because the result will be purple, the solution published in the public key. Cryptography uses the same idea of formulas that are easy to calculate in one direction, like mixing paint, but really hard to reverse unless you have one of the inputs. Instead of paint, digital security methods like DKIM use large numbers and [trapdoor](https://en.wikipedia.org/wiki/Trapdoor_function) one-way functions. ![Public Key Cryptography illustration]({{root_url}}/img/public_key_cryptography.png "Public Key Cryptography") _Alice encrypts a message with her private key, then sends the message to Bob. Bob decrypts the message with Alice's public key. Since the public key can only be used to decrypt messages signed with Alice's private key, we can trust that Alice was the author of the original message_. ## DKIM and SendGrid SendGrid automatically enables DKIM for all email to improve your email deliverability, whether you’re on a shared IP or a dedicated one. This is just one more example of how SendGrid helps thousands of customers follow email best practices to ensure maximum delivery for their emails. For more information, see [DKIM Records Explained]({{root_url}}/ui/account-and-settings/dkim-records/). ================================================ FILE: content/docs/glossary/dmarc.md ================================================ --- layout: page weight: 0 title: DMARC navigation: show: false seo: title: DMARC override: true --- Domain-based Message Authentication, Reporting and Conformance (DMARC) is a standard for determining the authenticity of the person or service sending email on behalf of a domain. DMARC attempts to minimize email [spoofing]({{root_url}}/glossary/spoofing/) by building on top of existing authentication standards. ## Domain-based Message Authentication DMARC supplements [DomainKeys Identified Mail (DKIM)]({{root_url}}/glossary/dkim/) and [Sender Policy Framework (SPF)]({{root_url}}/glossary/spf/), neither of which provide complete spoofing prevention on their own. DKIM and SPF handle the domain-based message authentication portion of DMARC. DKIM cryptographically signs messages. SPF defines the IP addresses approved to send email on a domain. For more about DKIM and SPF, see [DKIM Records Explained](/ui/account-and-settings/dkim-records/) and [SPF Records Explained](/ui/account-and-settings/spf-records/). ## Reporting and Conformance A DMARC record is implemented using a [TXT](https://en.wikipedia.org/wiki/TXT_record) DNS record. The tags in this TXT record tell receiving email servers how to handle email that fails either or both DKIM and SPF checks. The DMARC record also tells receiving servers where to send reports about the failures. The ability to provide receiving email servers with failure handling instructions and the opportunity to receive failure reports is incredibly valuable for domain owners. The information can be used to track down the people and services sending email on behalf of your domain, which is a first step in understanding your [sender reputation]({{root_url}}/glossary/reputation-monitoring/). This feedback loop is unique to the reporting and conformance mechanisms of DMARC. ## DMARC in detail DMARC is a powerful tool for understanding your sender reputation. For more information about DMARC, see [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) where we cover DMARC in detail. ================================================ FILE: content/docs/glossary/dns.md ================================================ --- layout: page weight: 0 title: DNS navigation: show: false seo: title: Domain Name System (DNS) override: true --- Domain Name System (DNS) translates a domain name into an IP address to find the owner’s site. Let's say that you type the URL www.sendgrid.com into your browser. The browser contacts a DNS server to get the IP address. A DNS server would start its search for an IP address by contacting one of the root DNS servers. The root servers know the IP addresses for all of the DNS servers that handle the top-level domains (.COM, .NET, .ORG, etc.). Your DNS server would ask the root for www.sendgrid.com, and the root would say, "I don't know the IP address for www.sendgrid.com, but here's the IP address for the .COM DNS server.” Your name server then sends a query to the .COM DNS server asking it if it knows the IP address for www.sendgrid.com. The DNS server for the COM domain knows the IP addresses for the name servers handling the www.sendgrid.com domain, so it returns those. Your name server then contacts the DNS server for www.sendgrid.com and asks if it knows the IP address for www.sendgrid.com. It actually does, so it returns the IP address to your DNS server, which returns it to the browser, which can then contact the server for www.sendgrid.com to get a Web page. For more information: * [CNAMES]({{root_url}}/glossary/cname/) * The SendGrid [Email Infrastructure Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) * [DNS in Wikipedia](https://en.wikipedia.org/wiki/Domain_Name_System) <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ================================================ FILE: content/docs/glossary/domain-authentication.md ================================================ --- seo: title: Domain authentication title: Domain authentication weight: 0 layout: page navigation: show: false --- Domain authentication shows email providers that SendGrid has your permission to send emails on your behalf. To give SendGrid permission, you point DNS entries from your DNS provider (like GoDaddy, Rackspace, or Cloudflare) to SendGrid. Your recipients will no longer see the “via sendgrid.net” message on your emails. Even though this is a small change from your recipients' perspective, this change has a huge positive impact on your reputation as a sender and your email deliverability. Email service providers distrust messages that don't have domain authentication set up because they can not be sure that the message comes from you. Explicitly stating that it comes from you increases your reputation with email service providers which makes it much less likely that they will filter your mail and not allow it get to your recipient's inbox, which increases your deliverability. You are also explicitly showing your recipients that this email comes from you, so they are less likely to mark your mail as spam. <call-out> In an attempt to clarify complex functionality, SendGrid is upgrading the name of Whitelabel. A whitelabel is now generally called sender authentication. A domain whitelabel is now called domain authentication. A link whitelabel is now called link branding. An IP Whitelabel is now called reverse DNS. </call-out> <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## Additional Resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ================================================ FILE: content/docs/glossary/domain.md ================================================ --- seo: title: Domain description: A named internet address that resolves to an IP address keywords: domain, url, domain name title: Domain weight: 0 layout: page navigation: show: false --- A domain is a named Internet address that resolves to the numbered Internet Protocol (IP) addresses computers use to connect. Examples: sendgrid.com, yourdomain.com, google.com. Simply put, it’s the web address your users type into their browser to learn about your company. If you are on a Pro 100k or above plan you will have your very own dedicated IP address which we encourage you to [set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ## SMTP Domain An example of one of the SendGrid domains is our SMTP domain: `smtp.sendgrid.com` ## More Information For more information, please read our [Email Infrastructure Guide.](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/drip-campaign.md ================================================ --- layout: page weight: 0 title: Drip Campaign navigation: show: false seo: title: Drip Campaign override: true description: Drip Campaigns are a type of automated email marketing strategy. --- A drip campaign is a type of automated [email marketing strategy]({{root_url}}/glossary/email-marketing/) that involves sending a recipient a series of pre-written messages according to a predetermined schedule. This schedule is often initiated by certain events in the recipient’s lifecycle as a customer, such as registering for a service or purchasing a product. Drip campaigns are used to generate or increase customer engagement over a period of time. Drip campaigns help you to send relevant and well timed emails that your customers are likely interested in seeing. Striving to send emails that are relevant to your recipients can help to improve your [sender reputation](https://sendgrid.com/blog/what-is-a-domain-reputation/), cultivate customer satisfaction, and increase customer retention. <call-out> Interested in sending automated drip campaigns? Doing so is simple with Marketing Camapigns Automation. Click [Marketing [new] in your account](https://mc.sendgrid.com/automations) to try this feature for free today. </call-out> ================================================ FILE: content/docs/glossary/drops.md ================================================ --- seo: title: Drops title: Drops weight: 0 layout: page navigation: show: false --- In certain cases, SendGrid will “Drop” a message to a specific email address in order to protect your sender reputation. SendGrid keeps Email Lists to track bounces, spam reports, and unsubscribes for each of our users. If a user sends a message to an email address that exists on one of these lists within their account, SendGrid will automatically drop the message (i.e., not send to the address). <call-out> SendGrid users can always delete entries from these lists if an email address is erroneously placed on one or more of them. Users can accomplish this by mousing over the entry for an address and clicking the “Delete” button. </call-out> ## Identifying Drops On the [Global Statistics Dashboard]({{root_url}}/ui/analytics-and-reporting/global/), the Drops can also be identified as Repeated Bounces, Repeated Spam Reports, Repeated Unsubscribes and Invalid Emails: You will also find drops in your [Email Activity](https://app.sendgrid.com/email_activity). Clicking on the event, will show more details about it, including the reason for which the email was dropped. <call-out> If the email address is on the Unsubscribe list the reason will say "Unsubscribed Address"; if on the Spam report list, it will say "Spam Reporting Address" and if on the Invalid Emails list, it will say "Invalid". </call-out> ## Other reasons for dropped emails: 1. Email triggers SendGrid's spam filters if you have the [Spam Checker filter]({{root_url}}/ui/account-and-settings/mail/#spam-checker) enabled. You can identify these drops only through the data received through the [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) or in [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/). In both cases, the reason displayed will say "Spam Content". 2. The SMTPAPI header is built incorrectly - this will cause the emails to be dropped with the reason "Invalid SMTPAPI header". For more details about how to build the SMTPAPI header, please view our documentation on [SMTP API]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/). 3. Duplicate message - emails are dropped with this reason only when they are sent through the Marketing Email App or through the Marketing API. If a recipient's address is showing on multiple lists and you assign those lists to one campaign, our systems automatically identify that the address is on multiple lists and drops the duplicate messages. This prevents having the same message sent to the same recipient multiple times. ## How to remove Drops If you would like us to attempt to deliver messages to a specific address again, please delete that address from the suppression list. On the suppression list page, you can remove an address from the bounces list. Then you will be able to send future messages without us intervening on your behalf; you're essentially telling us that this address should be fine, but something went wrong and you'd like to try again. <call-out> SendGrid cannot re-send messages that have been dropped or appear on suppression lists, but will attempt future deliveries once the address has been removed from the list and is sent to again. </call-out> **Since SendGrid has my back, and my reputation is not affected by these Drops, why should I care about removing them?** Your lists will be cleaner and even if we do drop the messages intended to addresses that are already on one of the suppression lists, we do accept and process these requests before we drop them. Since this is the case, dropped emails will still count towards your monthly plan email limit. ### Cleaning your lists We recommend using the [Web API]({{root_url}}/api-reference/) to export any of the suppression lists. Once you export that data, you can use it to clean your distribution lists. ================================================ FILE: content/docs/glossary/email-api-integration.md ================================================ --- seo: title: Email API Integration description: Email API integration allows senders to easily sync their email service provider with their platform and software tools to automate key functions keywords: email api integration, email api title: Email API Integration weight: 0 layout: page navigation: show: false --- Email API integration allows you to connect your email service provider to your own platform and your marketing, sales, or CRM tools. In doing so, you can sync data and create hybrid, customized systems that empower your workforce and leverage your technology via a single interface. The term API stands for Application Programming Interface. It’s essentially a language and message format that allows communication between the web application and the program that provides the services for the web app. With email API integration, you can simply define the parameters passed between your Email Service Provider (ESP) using some business logic and code, and set up advanced functionality between 2 or more separate applications. The main benefit of email API integration is automation. Depending on your ESP, you can use different types of email APIs to synchronize data or content, and automate many functions so you can spend less time administering your email programs. For example, by syncing your ESP with your web app, you can automatically remove emails with spam complaints from your entire database. Or, pull email response data from your ESP into your platform and deliver comprehensive reports to your team – all with a simple email API integration. When evaluating your email API integration needs, look for ESP providers with robust APIs with high performance. Try to determine your needs for the future, as you will likely want advanced customization as your grow. Do you want to sync your contacts, merge your analytics, send triggered emails in response to user actions, or cleanse your database based on a set of conditions? Once you determine what you want to do, identify the tools that need to speak to each other in order for the email API integration to work flawlessly. SendGrid provides a series of flexible web and SMTP APIs for easy email API integration for both transactional email and marketing email. We have a series of APIs, each of which provide comprehensive solutions to customize and power your platform, including: * [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) – This will notify a URL via HTTP POST of events that occur as SendGrid processes email. Most Event Webhook users automatically remove unsubscribes, determine unengaged recipients, identify bounced addresses, or react to spam reports. * [Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) – Parses the attachments and contents of incoming emails and POST the parsed email to a URL. This allows users to receive mail from any of the addresses on their recipient list. * [SMTP API]({{root_url}}/for-developers/sending-email/building-an-smtp-email/) – Allows users to specify custom-handling instructions for their email through a header inserted into the body of the message. The header can be added to any SMTP message sent to SendGrid. * [Web API]({{root_url}}/api-reference/) – Allows SendGrid customers to retrieve information and statistics about their account, including spam reports, bounces, and unsubscribes. All APIs are fully documented and many provide examples for you to test even the most complex email API integration scenarios. Moreover, our systems are set up to process thousands of requests each minute ensuring that you can power your app with the greatest speed and reliability. Bring your platform to the next level by integrating with SendGrid. ================================================ FILE: content/docs/glossary/email-authentication.md ================================================ --- seo: title: Email Authentication description: Technical standards to help ISPs and other receivers validate the identity of an email sender. keywords: authentication, SPF, DKIM, SenderID title: Email Authentication weight: 0 layout: page navigation: show: false --- Email authentication refers to technical standards that help ISPs and other receivers validate the identity of an email sender. There are three authentication standards in use: [SPF]({{root_url}}/glossary/spf/) developed by AOL, [Sender ID]({{root_url}}/glossary/sender-id/) developed by Microsoft and [DKIM]({{root_url}}/glossary/dkim/) developed by Yahoo!. ================================================ FILE: content/docs/glossary/email-harvesting.md ================================================ --- seo: title: Email Harvesting description: Email harvesting is the process of obtaining lists, either by purchase or theft, of valid email addresses for the purpose of sending bulk email or spam keywords: email harvesting, spam, email lists, malicious email practices title: Email Harvesting weight: 0 layout: page navigation: show: false --- Email harvesting is the process of obtaining lists, either by purchase or theft, of valid email addresses for the purpose of sending bulk email or spam, or in malicious instances, phishing attempts. Spammers may use bots to find valid email addresses on the Internet by spidering web pages. The CAN-SPAM Act of 2003 made it illegal to harvest email addresses via these automated means, and to sell or give away lists of recipients gathered for legitimate purposes. The email addresses of your customers are valuable, so SendGrid takes the security of your send lists very seriously. For tips on getting your messages to the Inbox, please see our [email deliverability page]({{root_url}}/ui/sending-email/deliverability/). ================================================ FILE: content/docs/glossary/email-marketing.md ================================================ --- seo: title: Email Marketing description: Email Marketing represent the email communications sent to promote a commercial product or service. keywords: email marketing title: Email Marketing weight: 0 layout: page navigation: show: false --- Email Marketing (also known as commercial or promotional email) as defined by the CAN-SPAM Act is any message in which the primary purpose “advertises or promotes a commercial product or service, including content on a website operated for a commercial purpose.” Examples of email marketing include: - Coupons - Newsletters - [Peer Initiated Invitations]({{root_url}}/glossary/peer-invitations/) - Product Announcements - Promotional Emails - [Reconfirmation Email Campaigns]({{root_url}}/glossary/reconfirmation/) - Special offers Email marketing attempts to encourage the recipient to take an action like making a purchase, downloading content, registering for a service, attending an event, or visiting a store. Since the intent of email marketing is to promote a commercial product or service, it must adhere to certain legal requirements defined in the CAN-SPAM Act that were specifically developed to protect consumers and help senders provide the best possible email experience. Following email best practices in your marketing emails can yield great rewards and doesn’t have to be difficult. Great content along with quality sending and data collection practices present prime opportunities for email marketing to yield high response rates that drive your customer acquisition strategy. SendGrid can help you achieve your email marketing goals with our [Marketing Email Service](https://sendgrid.com/solutions/email-marketing). This service provides the following and much more: - [Pre-designed email templates]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/) - [Importing Custom HTML With Drag & Drop Markup]({{root_url}}/ui/sending-email/editor/#importing-custom-html-with-drag--drop-markup) - [Ability to use your own HTML]({{root_url}}/ui/sending-email/editor/) - [Powerful analytics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) - [A/B testing]({{root_url}}/ui/sending-email/a-b-testing/) - [List Segmentation]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) This level of visibility into your email marketing performance is invaluable when it comes to determining what resonates best with your audience. Overall, the key to a successful email marketing is that it drives an action. You should strive to provide relevant content by using segmentation strategies to tailor your communications. This is best achieved by testing your design, content, and offers to determine what resonates best with your subscribers. ================================================ FILE: content/docs/glossary/email-service-provider.md ================================================ --- seo: title: Email Service Provider description: An email service provider provides transactional and marketing email services. keywords: Email service provider, ESP title: Email Service Provider weight: 0 layout: page navigation: show: false --- An Email Service Provider (ESP) is a service organization that provides transactional and/or marketing email services. Most ESPs include features that allow customers to: - Upload and maintain subscriber lists - Schedule and send marketing campaigns - Manage transactional email - Improve email deliverability - Monitor statistics of your email campaigns ESPs like SendGrid also provide expertise on increasing your [email deliverability]({{root_url}}/glossary/deliverability/), preserving your sending reputation. They may utilize features and tools to accomplish this, such as: - [Reverse DNS]({{root_url}}/glossary/reverse-dns/) - [Dedicated IPs](https://sendgrid.api-docs.io/v3.0/ip-addresses) - [IP warming]({{root_url}}/ui/sending-email/warming-up-an-ip-address/) An ESP may provide email services via a user interface (UI), or may also be an [SMTP provider]({{root_url}}/glossary/smtp-provider/). SendGrid provides both services. ================================================ FILE: content/docs/glossary/event-webhook.md ================================================ --- seo: title: Event Webhook description: Event Webhooks provides data about the email you send when the user takes an action. keywords: event webhook, webhooks title: Event Webhook weight: 0 layout: page navigation: show: false --- A webhook is an HTTP callback that allows a web application to POST a message to a URL when certain events take place. Often called “Reverse APIs,” Webhooks can be used to receive data in real time, pass it on to another application, or process the data faster than traditional APIs. Some of the traditional APIs that SendGrid provides include: * [SMTP API]({{root_url}}/for-developers/sending-email/getting-started-smtp/) – Provides custom handling instructions for email headers within messages. * [Web API]({{root_url}}/api-reference/) – Allows users to retrieve account information like bounces, unsubscribes, or spam reports. * [Marketing Email API](https://sendgrid.com/email-marketing) – Offers developers the ability to manage the lists, identities, and delivery events for marketing emails. * [Template Engine API](https://sendgrid.com/transactional-email) – Provides a way for marketers and developers to create, iterate, and deploy transactional email templates. While webhooks are traditionally more complex to set up, the speed and efficiency of webhooks have increased their popularity in the developer community. There are 3 main types of webhooks: * <strong>Push Webhooks</strong> – Enables users to receive data in real time. * <strong>Pipe Webhook</strong> – Not only enable the users to receive data in real time, but they also allow users to code it and take certain actions based on event triggers. * <strong>Plugin Webhooks</strong> - Enhance the capabilities of the platforms on both the sending and receiving level, allowing the sharing of data in a 2-way relationship. [SendGrid’s Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) combines the push, pipe, and plugin capabilities listed above. The Event Webhook notifies a URL via HTTP POST about events that take place with your email in the SendGrid platform. The Event Webhook then captures email-specific data related to unsubscribes, spam reports, bounced emails, and response data, and reports them in the manner in which you specify. With the Event Webhook, users can create advanced email analytics, customize the delivery of your email analytics to their platform, set up triggered email campaigns synced to third-party platforms, and insert dynamic data. In all, there are 9 email events that can be captured. Using the SendGrid Event Webhook allows users to follow the email best practices that will increase their [email deliverability]({{root_url}}/glossary/deliverability/). For instance, by immediately responding to bounces, unsubscribes, and spam reports, users can ensure that they’re always sending to a clean list. By using the open and click tracking, they can remove unresponsive users and ensure that they’re always sending to a highly engaged list. To help users take full advantage of the Event Webhook, SendGrid has also created the EventKit. The SendGrid EventKit allows users to create a user-friendly app where they download a *PHP* script and then upload it to their server in order to take advantage of the Event Webhook. You can learn more by visiting the [EventKit blog post](https://sendgrid.com/blog/open-source-eventkit-for-event-webhook/). In addition to the Event Webhook, SendGrid has also created the Parse Webhook to improve engagement with recipients. The [SendGrid Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) allows users to parse the contents and attachments of messages. Using Parse Webhook, SendGrid users can post blog articles or receive uploads directly from email replies. The webhook will then POST the parsed portions of the email to a URL specified by the user. SendGrid provides a full-service solution for solving your total [email delivery needs](https://sendgrid.com). We’re the world’s largest email infrastructure as a service provider working hand in hand with developers to ensure that we’re providing tools and services that solve real-world problems. ================================================ FILE: content/docs/glossary/expandable-banner.md ================================================ --- layout: page weight: 0 title: Expandable Banner group: glossary seo: title: Expandable Banner description: Definition of an Expandable Banner keywords: navigation: show: true --- ## Expandable Banner An Expandable Banner can increase in size when the user clicks or hovers over the banner. ================================================ FILE: content/docs/glossary/expired.md ================================================ --- seo: title: Expired description: Bounced - Expired emails are emails that are unable to be delivered within 72 hours. keywords: expired, bounce, undelivered email title: Expired weight: 0 layout: page navigation: show: false --- If an email bounces, we will retry for up to 72 hours. If the email is unable to be delivered within the last 72 hours, it will expire and be marked as Bounced - Expired. Bounced emails are commonly due to SMTP 4.X.X errors or SMTP 5.X.X errors, which cause an email to be undeliverable: - An expired, inactive, or disabled recipient address - The recipient's mailbox has exceeded its limit - An incorrect recipient email address - Domain frequency limited - Connection frequency limited - IP frequency limited - Too many invalid recipients ### Additional Resources - [Bounces]({{root_url}}/glossary/bounces/) - [Retrieve and Edit your List of Bounces](https://sendgrid.api-docs.io/v3.0/bounces-api) - [Email Activity & Bounces]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) ================================================ FILE: content/docs/glossary/feedback-loop.md ================================================ --- seo: title: Feedback Loop override: true description: A feedback loop is the process by which an ISP forwards emails reported as spam for immediate removal by the sender. title: Feedback Loop layout: page weight: 0 navigation: show: false --- A feedback loop is the process by which an ISP forwards emails reported as spam (see [complaint]({{root_url}}/glossary/complaint/)) for immediate removal by the sender. ================================================ FILE: content/docs/glossary/flighting-in-advertising.md ================================================ --- layout: page weight: 0 title: Flighting in Advertising group: glossary seo: title: Flighting in Advertising description: Definition of Flight or Flighting in Advertising keywords: navigation: show: true --- ## Flighting in Advertising Flighting or flight refers to the time when an advertising campaign is running. ================================================ FILE: content/docs/glossary/fqdn.md ================================================ -- seo: title: Fully Qualified Domain Name (FQDN) description: Definition of a fully qualified domain name as it relates to SendGrid. keywords: fqdn, fully qualified, dns, hostname, fully qualified domain, pqdn, tld title: Fully Qualified Domain Name (FQDN) group: glossary weight: 0 layout: page navigation: show: true --- A Fully Qualified Domain Name (FQDN) is the complete domain name for a specific location in the Domain Name System (DNS) hierarchy. This is sometimes referred to as the absolute domain name. The hierarchy can be broken down into a few parts: - Top-Level Domain (TLD), such as .edu or .com - Partially Qualified Domain Name (PQDN) or domain name, such as example.com - Fully Qualified Domain Name (FQDN) or host name, such as mail.example.com The format of FQDN includes all hierarchical parts, usually [hostname].[domainname].[tld]. A mail server, for example with SendGrid, could be specified by an FQDN such as `mx.sendgrid.net` as this provides the complete domain for a specific mail server. When connecting to a host the specification of a FQDN allows for the DNS to resolve the hostname to its specific IP in order to verify the connection and successfully send mail. ================================================ FILE: content/docs/glossary/frequency-capping.md ================================================ --- layout: page weight: 0 title: Frequency Capping group: glossary seo: title: Frequency Capping description: Definition of Frequency Capping keywords: navigation: show: true --- ## Frequency Capping In advertising, frequency capping refers to the maximum number of times a specific visitor to a website is shown a particular advertisement. ================================================ FILE: content/docs/glossary/gdpr.md ================================================ --- seo: title: General Data Protection Regulation (GDPR) description: The General Data Protection Regulation (GDPR) of the European Union (EU) is a law that regulates the handling of personal data and outlines the rights individuals have with regard to their data. keywords: Data, Privacy, Europe, Processing, Requirements title: General Data Protection Regulation (GDPR) weight: 0 layout: page navigation: show: false --- ## GDPR The General Data Protection Regulation (GDPR) of the European Union (EU) is a law that regulates the handling of personal data and outlines the rights individuals have with regard to their data. It was implemented on May 25, 2018. It applies to any [“individual, company, or organisation”](https://ec.europa.eu/info/law/law-topic/data-protection/reform/what-does-general-data-protection-regulation-gdpr-govern_en) that processes the data of a person in the EU. This applies whether the organization is based in the EU or elsewhere. ## The Purpose of the GDPR The European Union views the protection of personal data as a fundamental right of [natural persons](https://en.wikipedia.org/wiki/Natural_person). The GDPR establishes requirements of organizations that process data, defines the rights of individuals to manage their data, and outlines penalties for those who violate these rights. To better understand the GDPR, you should know what qualifies as **personal data** and data **processing**. ### Personal data Think of **personal data** as any information that can be used to identify someone or is associated directly or indirectly with a living individual. This includes a person’s name, driver’s license number, location data, IP address, biometric data, and more. ### Processing **Processing** is a broad term that encompasses nearly any use of personal data, including collection, storage, organization, alteration, destruction, and transmission. For all intents and purposes, any use of personal data is considered processing. ## Information for Senders Of particular importance to those who manage an email list is the requirement to obtain and document consent* from recipients on that list. This means that the individual recipient must opt into receiving emails, for example, by signing up online. You must maintain a record of the recipient having signed up. It also means that the recipient can opt out of receiving emails, and the sender must honor their request. Also, it has to be just as easy to opt out as it was to opt in. It is important to keep an up-to-date record of that consent so that emails are not sent to recipients who have opted out of receiving them. *There are a number of different legal reasons for which your organization might be processing personal data. Some uses of data don’t require consent—for example, you don’t need the consent of a signatory to retain their name and signature on a business contract. But when it comes to maintaining an email mailing list, you should get consent from your recipients. If you need only an email address to achieve your specific business purpose, an email address is all you should store. The GDPR requires that you process only the data necessary for a legitimate business need and nothing more. All this processing should also be done securely with [Privacy by Design and by default](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.ENG&toc=OJ:L:2016:119:FULL#d1e3022-1-1). ### Controllers and Processors Under the GDPR, an organization processing personal data acts as either a **controller** or a **processor**. A controller determines the purpose for processing the data. Whether the controller processes the data itself or contracts another party to do the processing, the controller decides how the data are used. A processor processes data only on behalf of the controller. The sole objective of the processor is to process the data for the controller. For example, if you maintain a large email marketing list and use SendGrid to deliver promotions, you’re considered the controller, and SendGrid is your processor. You set the business purpose and control the data. SendGrid processes that data on your behalf. Many businesses are both controllers and processors. You can read more in [Chapter IV](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.ENG&toc=OJ:L:2016:119:FULL#d1e3022-1-1) of the full GDPR legal text. We also have a [blog post](https://sendgrid.com/blog/general-data-protection-regulation-what-senders-need-to-know/) with more detail about what you need to know as an email sender. ### The Rights of Your Customers The GDPR is meant to provide rights to natural persons. For this reason, your customers may request that their data be updated or even erased in certain circumstances. If data subjects want to move their data to another service, they are free to do so. Their data should be provided to them in a common machine-readable format that other organizations can understand. When communicating with individuals, they also have a right to receive that communication in plain and transparent language. For more about the rights of a data subject, see [Chapter III](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.ENG&toc=OJ:L:2016:119:FULL#d1e2161-1-1) of the full GDPR text. ## SendGrid and the GDPR SendGrid believes the GDPR is an important move in the right direction. We value our customers’ data. That’s why we’re [Privacy Shield](https://www.privacyshield.gov/welcome) certified, GDPR compliant, and we protect personal data throughout the entire processing chain. For more information, please visit our [GDPR page](https://sendgrid.com/resource/general-data-protection-regulation-2/) or browse our [FAQ](https://sendgrid.com/files/SendGrid-FAQ.pdf). ## Next Steps Secure email at scale is just an API away. Deliver your first [SendGrid powered email](https://sendgrid.com/docs/for-developers/sending-email/api-getting-started/) today with our API quickstart. Is marketing on your mind? Engage your customers with [SendGrid Marketing Campaigns](https://sendgrid.com/docs/ui/sending-email/how-to-send-email-with-marketing-campaigns/). ================================================ FILE: content/docs/glossary/header.md ================================================ --- layout: page weight: 0 title: Header navigation: show: false seo: title: Header override: true description: An email header is the information that tells email recipients and servers where the email has come from and where it should go. --- The documentation that accompanies the body of an email message, the header contains information on the email and the route it has taken across the Internet. Email readers display the “to” (identity of the recipient) and “from” (identity of the sender) in the inbox. More information: * [Managing headers with SMTPAPI]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/) * [Managing headers with the Web API]({{root_url}}/for-developers/sending-email/api-getting-started/#build-your-api-call) * [Transactional Email Templating]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) ================================================ FILE: content/docs/glossary/imap.md ================================================ --- layout: page weight: 0 title: IMAP navigation: show: false seo: title: IMAP - Internet Message Access Protocol override: true description: IMAP is a protocol many applications use to retrieve mail from your mail server --- Internet Message Access Protocol (IMAP) is a communication protocol used by applications and servers for retrieving emails from email servers. Email programs like Microsoft's Outlook and Mozilla's Thunderbird use this protocol to contact servers and download messages for local storage and viewing offline. It is widely used by most email service providers, including Gmail and Yahoo!. For more information, read the [Wikipedia article](https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol). For technical information read the [RFC 3501](https://tools.ietf.org/html/rfc3501). ================================================ FILE: content/docs/glossary/invalid-email.md ================================================ --- layout: page weight: 0 title: Invalid Email navigation: show: false seo: title: Invalid Email override: true description: --- An [invalid email]({{root_url}}/ui/sending-email/invalid-emails/) occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards. Examples include addresses without the “@” sign or addresses that include certain special characters and/or spaces. This response comes from our own server since an invalid email is impossible to even attempt to send to its [non-existent] destination. <call-out> Invalid drop events are retained for 30 days. </call-out> ================================================ FILE: content/docs/glossary/ip-address.md ================================================ --- seo: title: IP Address description: A unique numerical address that defines an internet location. keywords: title: IP Address weight: 0 layout: page navigation: show: false --- An Internet Protocol (IP) Address is a unique numerical address that defines an internet location. These addresses have 4 sets of numbers separated by periods. For example, 127.0.0.1 is an IP address. IP addresses are included in the headers of all emails sent, they are a sort of return address for a given email message. One of the reputation indicators used by recipient mailbox providers is a sender's IP address. At SendGrid, you can be on a shared IP address, or you can have a dedicated IP address. We recommend a dedicated IP address for people sending high volumes of email or for people who want control over the quality of mail sent on the same IP as theirs. The aggregate performance of all the senders who use the IP determines its reputation. <call-out> If you are on a Pro 100k or above plan you can see your IP reputation and IP address on your Account Overview page. </call-out> For more information: * [SendGrid Email Infrastructure Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) * [Setting up Reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ================================================ FILE: content/docs/glossary/ip-warmup.md ================================================ --- layout: page weight: 0 title: IP Warmup navigation: show: false seo: title: IP Warmup override: true description: Initially splitting up the email send requests from a new dedicated IP, so it doesn't get blocked. keywords: IP, warm, up, warmup, ramp, ramping --- [IP warming]({{root_url}}/ui/sending-email/warming-up-an-ip-address/) is the gradual process of establishing a reputation as a legitimate email sender in the eyes of ISPs (Internet Service Providers). When an ISP observes email suddenly coming from a new or “cold” (recently dormant) IP address, they will take notice and immediately begin evaluating the traffic coming from that IP. ISP spam filters look at volume as a significant factor when determining whether or not you are sending spam. Because of this, we recommend that you begin sending a low to moderate volume ( up to 1 million emails/month), eventually working your way up to larger volumes (over 1 million emails/month). This gives the receiving email providers a chance to closely observe your sending habits and the way your customers treat the emails they receive from you. <call-out> You can now warmup your IP using our [IP Warmup API](https://sendgrid.api-docs.io/v3.0/ip-warmup). </call-out> When you place your IP in warmup mode, we divide your email requests between the dedicated IP you wish to warmup and any other warm, dedicated IPs currently assigned. Each day we will increase the amount sent directly from your warming dedicated IP. You can see the suggested [IP Warmup Schedule]({{root_url}}/assets/IPWarmupSchedule.pdf). <call-out type="warning"> We recommend the IP warmup tool only for users that have other warm, dedicated IPs which can accept any overflow email traffic as we gradually increase the volume sent through the warming IP. If you do not have other dedicated IPs and are building your reputation from scratch, recommend that you follow [this]({{root_url}}/assets/IPWarmupSchedule.pdf) warmup schedule. </call-out> ================================================ FILE: content/docs/glossary/link-branding.md ================================================ --- seo: title: Link branding title: Link branding weight: 0 layout: page navigation: show: false --- Email link branding allows all of the click-tracked links and opens tracked images in your emails to be from your domain instead of from sendgrid.net. Spam filters and recipient servers look at the links within emails to determine whether the email looks trustworthy enough to deliver - they use the reputation of the root domain to determine whether the links can be trusted. Implementing link labeling helps in email deliverability because you are no longer relying on click tracking going through a domain that you do not control. <call-out> In an attempt to clarify complex functionality, SendGrid is upgrading the name of Whitelabel. A whitelabel is now generally called sender authentication. A domain whitelabel is now called domain authentication. A link whitelabel is now called link branding. An IP Whitelabel is now called reverse DNS. </call-out> ## Additional Resources - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ================================================ FILE: content/docs/glossary/lists.md ================================================ --- seo: title: Lists description: Lists are simply static collections of Marketing Campaigns contacts. keywords: title: Lists weight: 0 layout: page navigation: show: false --- Lists are static collections of Marketing Campaigns contacts. By default, the ALL CONTACTS section stores any new contacts you add. You may create new lists when adding contacts either manually, or when uploading a CSV (comma separated values) file. When you send an email campaign, you can add contact lists to the specific recipient segments you wish to target. For more information about Lists, please see our [Building your contact lists]({{root_url}}/ui/managing-contacts/building-your-contact-list/). ================================================ FILE: content/docs/glossary/mail-merge.md ================================================ --- layout: page weight: 0 title: Mail Merge navigation: show: false seo: title: Mail Merge override: true description: Mail Merge is a process to create customize emails from a generic form or template. --- Mail Merge is a process to create customized emails, letters, and documents from a generic form or template. The original document contains static text with placeholders for substitutions for elements like names, addresses, emails, or other individualized or unique information. Typically, the data used to populate these placeholders is held in a database, spreadsheet, or CSV file. A column in a spreadsheet could contain a list of names that correspond with a list of email addresses. These would then be populated into the template, creating a customized email per email address. This functionality can be replicated using SendGrid's [SMTP API]({{root_url}}/for-developers/sending-email/building-an-x-smtpapi-header/), using [Substitution Tags]({{root_url}}/for-developers/sending-email/substitution-tags/) and [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) in [Marketing Campaigns]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/) for marketing emails and our [transactional templates application](https://sendgrid.api-docs.io/v3.0/transactional-templates) for transactional emails. ================================================ FILE: content/docs/glossary/mailbox-provider.md ================================================ --- seo: title: Mailbox Provider description: An email service provider provides transactional and marketing email services. keywords: Mailbox Provider, Email service provider, ESP title: Mailbox Provider weight: 0 layout: page navigation: show: false --- A mailbox provider, mail service provider or Email Service Provider (ESP) is a service organization that provides transactional and/or marketing email services. ## Additional Resources [Email Service Provider (ESP)]({{root_url}}/glossary/email-service-provider/). ================================================ FILE: content/docs/glossary/message-id.md ================================================ --- layout: page weight: 0 title: SendGrid Message ID navigation: show: false seo: title: Message ID override: true description: The SendGrid Message ID is a unique identifier generated and assigned by SendGrid for event identification purposes. --- The SendGrid Message ID, is a unique identifier assigned to individual email messages by the email server responsible for sending the message. SendGrid will create a Message ID for each individual message you send through our systems. This Message ID information is searchable in the SendGrid Activity Feed as well as Event Webhook POST data. The Activity Feed references the Message ID as "Message ID" and the Event Webhook references it with `sg_message_id`. **Please Note**: The SendGrid assigned Message ID is different than an X-Message-ID given in response headers when sending via API. While this ID is contained in the SendGrid assigned Message ID, the X-Message-ID is specific to the API request prior to messages being broken up individually in SendGrid email servers and then assigned the SendGrid Message ID. The SendGrid Message ID accounts not only for the original request but also server data and the specific identification between a unique message and recipient. Example SendGrid Message ID: **XBg2anf2TqCy6WXKQFhieQ.filter0905p1mdw1-4434-59E0C6FF-3.0** ================================================ FILE: content/docs/glossary/mta.md ================================================ --- seo: title: MTA description: MTA stands for Mail Transfer Agent. It is software that transfers electronic mail messages from one computer to another using a client–server application architecture. keywords: MTA, Mail Transfer Agent, Mail Relay title: MTA weight: 0 layout: page navigation: show: false --- Mail Transfer Agent or Message Transfer Agent (MTA) is software that transfers electronic mail messages from one computer to another using a client–server application architecture. An MTA implements both the client (sending) and server (receiving) portions of the [Simple Mail Transfer Protocol]({{root_url}}/glossary/smtp/). To get more information please check out our [Email Infrastructure Guide.](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/mx-record.md ================================================ --- layout: page weight: 0 title: MX Record navigation: show: false seo: title: MX Record override: true description: An Mail Exchanger Record specified the mail server responsible for accepting email on behalf of a domain --- A Mail Exchanger (MX) record in the DNS system specifies a mail server responsible for accepting email addresses on behalf of a domain. The MX records associated with a domain assure that the email is properly routed via [Simple Mail Transfer Protocol]({{root_url}}/glossary/smtp/) (SMTP). ================================================ FILE: content/docs/glossary/native-advertising.md ================================================ --- layout: page weight: 0 title: Native Advertising group: glossary seo: title: Native Advertising description: Definition of Native Advertising keywords: navigation: show: true --- ## Native Advertising Native advertising refers to ads that operate like paid ads but differ in appearance. The native advertising unit does not really appear like an advertisement but looks like the native content on the page. Native advertising is often found in social media feeds or appear as recommended content on a webpage. ================================================ FILE: content/docs/glossary/open-rate.md ================================================ --- layout: page weight: 0 title: Open Rate navigation: show: false seo: title: Open Rate override: true description: The rate in which your customers open emails you've sent to them. --- The “Opens” percentage is the total number of times your users opened your emails, divided by the total number of Delivered messages. The “Unique opens” percentage is the number of unique individuals that have opened your emails, divided by the total number of Delivered messages. <call-out> Tracking open rates requires that the Open Tracking app be enabled. </call-out> *To enable the Open Tracking app:* 1. Navigate to **Settings** and select **Tracking**. 1. Locate the line that says Open Tracking and select the action menu to expand the line. 1. Toggle the switch to **On**. Open Tracking is now enabled. For more information visit our [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) page. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/openrelay.md ================================================ --- layout: page weight: 0 title: Open Relay navigation: show: false seo: title: Open SMTP Relay description: An SMTP server configured in such a way that it allows anyone on the Internet to send email through it. --- An [SMTP server]({{root_url}}/glossary/smtp-server/) configured in such a way that it allows anyone on the Internet to send email through it, not just mail destined for or originating from known users. This is not a recommended configuration because it can be exploited by spammers. Servers with open relays are routinely blocked. To get more information please check out our [Email Infrastructure Guide.](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/opens.md ================================================ --- layout: page weight: 0 title: Opens & Unique Opens navigation: show: false seo: title: Opens & Unique Opens override: true description: Track how many times your emails are opened with SendGrid --- SendGrid inserts a small, transparent image into all emails that will be tracked. When a customer reads an email, their client application loads the tracking image which registers the open event with SendGrid. Not all email clients load images by default. Microsoft’s Outlook, Apple’s Mail.app, Mozilla’s Thunderbird, and Google’s Gmail do not load images. As such, there may be many occasions where recipients will have received a message, opened it, and it will never be counted as opened because there is no way to track the event. In [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) the "opens percentage" is the total number of times your users opened your emails, divided by the total number of Delivered messages. The “Unique opens” percentage is the number of unique individuals that have opened your emails, divided by the total number of Delivered messages. <call-out> SendGrid will store tracking data for unique open events for up to 7 days. </call-out> <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/peer-invitations.md ================================================ --- layout: page weight: 0 title: Peer-initiated Invitations Campaign navigation: show: false seo: title: Peer-initiated Invitations Campaign override: true description: Peer-initiated Invitations are a Marketing Email campaign where you get customers to invite their friends and family. There are some caveats to consider about this marketing method. --- Peer-initiated invitations are a common way of launching a new business and gain awareness. If done right they can enable your subscribers spread the word about your service and grow your user base. An aggressive invitation system can backfire, and your invitations will be filtered or blocked. SendGrid customers who implement a peer-initiated invitation system must abide by the following requirements: * Never allow your subscribers to send invitations to their entire address book. Address books can and often do contain old or stale addresses that ISPs use as [spam traps]({{root_url}}/glossary/spam-traps/). If your invitations hit spam traps then your subsequent messages will be filtered by ISPs. To prevent this, design your invitation system so that your inviter must deliberately selects each individual invitee. By limiting the number of invitations each customer sends you are encouraging selective and quality invitations. When your customers are careful to invite only those who they think will appreciate your service, you reduce the risk of invitees reporting the invitations as spam. If enough people report your invitations as spam, your invitations will begin to be blocked or filtered by spam filters and Email Service Providers, which is not what you intended. * Clearly display the inviter's name or email address in the invitation email, then the invitee will easily see who sent the invitation. Peer-initiated invitations are most effective when the invitee knows and trusts the inviter. A good way to think about how to build your email template is to consider, "If I got this email from my friend, would I click it?" or "What would I expect my mom to do with this email if she received it and I didn't work for this brand?" * The From address on your invitation email should reflect your brand, especially if your system is sending this email. Don't use the inviter's email address for the invitation's From address. * Clearly express the purpose of the invitation so that recipients easily understand what they are being invited to. * After the initial invitation, don't send more than one follow-up (reminder) email to invitees that didn't respond to the first invitation. <call-out> You increase the odds of your invitations reaching the recipient when you structure your systems and processes to send the right message, to the right person, at the right time, with the right frequency. If you don't, your messages will be marked as spam and your marketing results will suffer. </call-out> SendGrid also strongly recommends: * Ensure your invitation is relevant and valued by the recipient. You can allow your customers to add a personal text-only message to their invitation. Don't allow URLs to be added, as they may be used to exploit or infect the invitee. * Include a conspicuous, functioning opt-out link as it's better for the recipient to remove themselves from future mailings than to report your message as spam. * Beware of offering invitation incentives to your subscribers. Incentives may encourage them to invite people who aren't likely to want your service, which can lead to more spam reports. * Monitor your spam complaints. Some inviters will trigger spam complaints by sending invitations to people who don't want them. If your system correlates spam complaints with the troublesome inviter, you can limit their invitation quota to minimize the adverse effect on your email sending reputation. * Typos happen. Pre-screen the email addresses you collect before you send the invitation. Make sure that the addresses are syntactically correct and that the domain part of the address has a DNS MX record (which indicates that the domain accepts mail). * Do not add invitees to your contact database until the invitee opts-into being on your list. ================================================ FILE: content/docs/glossary/phishing.md ================================================ --- seo: title: Phishing description: A technique for acquiring information such as user names, passwords, credit cards, social security numbers and other personal data by masquerading as a trusted business. keywords: phish, phishing, spam title: Phishing weight: 0 layout: page navigation: show: false --- Phishing is a technique for acquiring information such as user names, passwords, credit cards, social security numbers or other personal data by masquerading as a trusted entity like a bank or credit card company. Phishing emails appear to be sent by the trusted entity, which can cause the consumer to be tricked into providing their personal information. SendGrid employs both technology and staff to prevent the sending of phishing emails. We have a solid track record of working with the global email community to detect and stop the sending of phishing and spam emails. To get more information please check out our [Email Infrastructure Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/). ## Reporting Email Abuse SendGrid works hard to keep our email stream clean. Despite our best efforts, spam does occasionally leak through our defenses. If you discover spam that was sent by a SendGrid customer, please report it to our team by sending it to abuse@sendgrid.com or opening a ticket with [SendGrid Support](https://support.sendgrid.com/hc/en-us). No matter who sent the phishing email, you can file a report with the [Federal Trade Commission](http://www.ftc.gov/complaint). If we find that a SendGrid customer is sending spoofed or phishing emails, we will ban their account immediately ================================================ FILE: content/docs/glossary/preheader.md ================================================ --- seo: title: Preheader description: A preheader is the short summary text that follows the subject line when an email is viewed in the inbox. Many mobile, desktop, and web email clients provide them to tip you off on what the email contains before you open it. keywords: Preheader, Preheaders, Johnson Box title: Preheader weight: 0 layout: page navigation: show: false --- A preheader is the short summary text that follows the subject line when an email is viewed in the inbox. Many mobile, desktop, and web email clients provide them to tip you off on what the email contains before you open it. Along with the subject line, the preheader text is the first thing subscribers come into contact with when they receive your email campaign. Many businesses use preheaders in their email marketing campaigns to get more subscribers to open and read their emails – and to ensure that their campaigns are as deliverable as possible. It’s these 2 elements that they use to decide whether or not to open your campaign, and without getting your email opened it’s impossible to get people to click-through and take your desired conversion action (like making a purchase on your website for instance). ================================================ FILE: content/docs/glossary/programmatic-media-buying.md ================================================ --- layout: page weight: 0 title: Programmatic Media Buying group: glossary seo: title: Programmatic Media Buying description: Definition of Programmatic Media Buying keywords: navigation: show: true --- ## Programmatic Media Buying Programmatic media buying is an approach to buying paid media through sophisticated software that automates how you buy, place and optimize paid media. It allows you to segment your targeting by demographics or geography. You can also determine the frequency your ads are displayed and where your ads are published without manual intervention. ================================================ FILE: content/docs/glossary/rate-limiting.md ================================================ --- seo: title: Rate Limiting description: Rate limiting happens when a recipient mail server doesn't allow emails to be delivered at the same rate as they were sent. keywords: rate limiting, throttling title: Rate Limiting weight: 0 layout: page navigation: show: false --- There are limitations to delivery rates imposed by recipient mail servers. Exceeding these limitations results in a practice referred to as [throttling]({{root_url}}/glossary/throttling/). Throttling in terms of email means that a recipient mail server has accepted all the mail it is willing to accept from your IP for a certain period of time. Please visit our [pricing page](https://sendgrid.com/pricing?mc=SendGrid%20Documentation) to see the account specific sending limits. ================================================ FILE: content/docs/glossary/reconfirmation.md ================================================ --- layout: page weight: 0 seo: title: Reconfirmation Email Campaigns title: Reconfirmation Email Campaigns navigation: show: false --- ## How do you know if email subscribers are active or not? A common problem for senders is when a recipient will opt-in to receive their emails but after a certain period of time, these opted in emails do not make it to the mailbox. Worse, this leads to recently opted in addresses missing out on this senders emails as well. These addresses have opted in so what is the issue? Monitoring engagement is the best tool in ensuring a good reputation as a sender. In the past few years, there has been a large push to determine whether emails will make it to the mailbox by past engagement with that sender. Popular receiving mailboxes like Gmail, Yahoo! and Hotmail use engagement tracking to decipher which emails to put in the spam folder, bounce, or allow passage to a user's mailbox. Furthermore, many mailboxes now have the option to prioritize emails automatically so that there are 2 different categories of email; those deemed by the mailbox as important and those that aren't. This is almost entirely determined by whether or not recipients click on their emails or even better, if they reply. This increases the ante for senders to send content that recipients will engage with. Thankfully, SendGrid provides a window into the problem. Senders are able to make use of the [Event API]({{root_url}}/for-developers/tracking-events/event/) which allows senders to know if recipients have opened and/or clicked on their emails. Lower tier plans can view this information under the Email Activity tab. With these tools, a sender can ensure that they are not sending to 2 major pitfalls: [spam traps]({{root_url}}/glossary/spam-traps) or recipients that are likely to acknowledge the email as [spam]({{root_url}}/glossary/spam/). Sending to either of these recipients, results in the receiving mailbox to believe that they are uninterested and therefore, leads to diversion of emails to the unimportant or spam folders. Monitoring engagement provides a sustainable solution to sending that leaves both the sender and the recipients better off. Once you have been monitoring, you are primed to take some action with the subscribers who have not been active recently. You can do this with a Reconfirmation Campaign. ## What is a Reconfirmation Campaign? In order to maximize your email [deliverability]({{root_url}}/glossary/deliverability/), it is important to keep your address list current and clean. A reconfirmation email, otherwise known as a re-opt in email, reminds clients you correspond with about your business (which can increase your inbound marketing).This effectively cleans your lists with minimal impact to your deliverability, and prevents inadvertently spamming your clients. ## Why Reconfirm? As you opt-in your recipients, the email addresses provided to you initially may become obsolete. These addresses might become abandoned and eventually recycled or converted to [spam traps]({{root_url}}/glossary/spam-traps/). Or your recipients might simply become disinterested in receiving your emails. This can cause problems for your email deliverability. Old addresses become undeliverable and subsequent sending will result in bounces. Recipients that have become disinterested are more likely to mark your mail as spam, especially if there is no easy opt-out method in the email. To prevent these problems, we recommend using re opt-in messages. These emails remind your recipients of your services they once opted in, and politely ask for the recipient's permission to continue sending emails. ## How do I Reconfirm? Send an email with two links: one link to re-opt in the recipient, and the other link to opt-out the recipient. If they do not explicitly opt back in with this email, their address should be removed from your list as this is an indication your recipient is not engaging in your emails. This could be a sign that you are sending to someone that does not care for your emails, or even worse, you could be sending to a spam trap. If you are set up with SendGrid's Event API, click and open events are an excellent way to track which of your users have been unengaged and might be the best targets for your reconfirmation emails. You can even make your reconfirmation emails specific to a particular segmented list if your address lists are set up in this fashion. This approach is much more favorable than trying to clean a large old address list all at once. Sending to a 10-year-old list (or even a 3-month-old list) can produce a high bounce rate and cause your unengaged recipients to mark your emails as spam. Email service providers discourage this type of sending because of these results. Keep in mind, the older the list, the bigger the headache it will be to clean. ## How Often Should We Reconfirm? We recommend sending re opt-in messages to recipients who you haven't corresponded with or otherwise interacted with via email in over **3 months**. This may seem like a short duration, however, you might be surprised with how quickly your recipients can lose interest in your emails. Of course there are many types of businesses and this recommendation of 3 months is only a suggestion. Ultimately, the more frequently you clean your address list, the less likely you will have deliverability problems related to old lists. ================================================ FILE: content/docs/glossary/request.md ================================================ --- seo: title: Request description: A request is recorded every time an application attempts to send an email through SendGrid's servers. keywords: request, statistics title: Request weight: 0 layout: page navigation: show: false --- Whenever your application or server attempts to send an email to one of your customers via SendGrid, we will record that as a request to your SendGrid dashboard. In other words, when you send emails through SendGrid, you are essentially requesting, "Hey could you deliver this message for me?". Visit [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) to find more information about all the statistics SendGrid provides. ================================================ FILE: content/docs/glossary/reseller-email-account.md ================================================ --- seo: title: Reseller Email Account description: Some companies may resell SendGrid's services by having a formal Reseller Partnership with SendGrid. keywords: title: Reseller Email Account weight: 0 layout: page navigation: show: false --- Having a Reseller Email account means SendGrid has a formal reseller partnership with a company and all billing and usage is integrated into SendGrid. This usually means a platform is reselling SendGrid’s product under their own platform. SendGrid makes it easy to manage your customers via our [Reseller API](https://www.twilio.com/docs/sendgrid/api/v2/Reseller_API). ================================================ FILE: content/docs/glossary/reserved-fields.md ================================================ --- seo: title: Reserved Fields description: Reserved fields are those custom fields that cannot be deleted and do not count towards your allotment of 60 custom fields. They include fields such as email, first_name, and last_name in Marketing Campaigns. keywords: title: Reserved Fields weight: 0 layout: page navigation: show: false --- [Reserved Fields]({{root_url}}/ui/managing-contacts/custom-fields/) are those custom fields that cannot be deleted and do not count towards your allotment of 60 custom fields. They include fields such as **email**, **first_name**, and **last_name** in Marketing Campaigns. ================================================ FILE: content/docs/glossary/reverse-dns.md ================================================ --- seo: title: Reverse DNS description: Reverse DNS is a method of resolving an IP address into a domain name. keywords: DNS, reverse DNS, domain name service, domain title: Reverse DNS weight: 0 layout: page navigation: show: false --- Setting up reverse DNS on IP addresses allows mailbox providers to verify the sender when they do a reverse DNS lookup upon receipt of the emails you send. When you update your DNS provider with a DNS record provided by SendGrid, and then send mail over your IP, the recipient's email service provider performs a reverse DNS lookup (rDNS) using an A Record (address record). An A Record maps your domain to your IP address. When a mailbox provider looks up your A Record, they see your SendGrid IP address. When they look at your IP address, they see the rDNS that match your A Record. This circular checking proves your SendGrid IP association with your domain and your domain association with your SendGrid IP. <call-out> In an attempt to clarify complex functionality, SendGrid is upgrading the name of Whitelabel. A whitelabel is now generally called sender authentication. A domain whitelabel is now called domain authentication. A link whitelabel is now called link branding. An IP Whitelabel is now called reverse DNS. </call-out> <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## Additional Resources - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ================================================ FILE: content/docs/glossary/scheduled-emails.md ================================================ --- seo: title: Scheduled Emails description: Scheduling emails allows the ability to have the email send process to begin at a certain time keywords: scheduled emails, sending emails at a specific time title: Scheduled Emails weight: 0 layout: page navigation: show: false --- Scheduling emails provides the ability to have the email sent at a certain time. For example, if I am a retailer who has a promotion starting at 10:00am, i want the email to land as close to that time as possible. Scheduling can support this. Whether using [Marketing Campaigns](https://sendgrid.api-docs.io/v3.0/single-sends/create-single-send) or [our transactional APIs]({{root_url}}/for-developers/sending-email/scheduling-parameters/), you can define parameters on when to send a single email or batches of emails. <call-out> If you have the flexibility, it's better to schedule mail for off-peak times. Most emails are scheduled and sent at the top of the hour or half hour. Scheduling email to avoid those times (for example, scheduling at 10:53) can result in lower deferral rates because it won't be going through our servers at the same times as everyone else's mail. </call-out> ================================================ FILE: content/docs/glossary/segmentation.md ================================================ --- seo: title: Segmentation description: The practice of separating different types of email traffic. keywords: segmentation, email traffic, sender verification, IP pooling title: Segmentation weight: 0 layout: page navigation: show: false --- Segmentation refers to the practice of separating the different types of email that you send, such as marketing email and transactional email. By segmenting your email traffic, you can both obtain more useful engagement statistics and improve your [deliverability]({{root_url}}/glossary/deliverability/). Segmentation can be achieved by either creating and sending mail through a new subuser, or by [creating a new subuser]({{root_url}}/ui/account-and-settings/subusers/#create-a-subuser) and purchasing a separate [dedicated IP address]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/) to send that subuser's mail through. SendGrid's [IP Pooling feature](https://sendgrid.api-docs.io/v3.0/ip-pools) is a powerful tool that allows you to set up separate IP pools that you can use to organize your dedicated IPs. When sending different types of email, you can specify which IP Pool to associate your message with, and the IP Pooling feature will automatically **segment** your traffic by sending it through the corresponding dedicated IP address. <call-out> For more information about how you can segment your email traffic, please see [Segmenting Your Contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/). </call-out> ================================================ FILE: content/docs/glossary/segments.md ================================================ --- seo: title: Segments description: Segments are dynamic collections of Marketing Campaigns contacts grouped together, or segmented, based on the criteria you define. keywords: weight: 0 layout: page navigation: show: false --- [Segments]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) are dynamic collections of Marketing Campaigns contacts grouped, or segmented, based on the criteria you define. Groups can include data you track about them, such as gender, location, birthday, or package type, or how they've engaged with your emails previously. You can create a segment that pulls from ALL CONTACTS or a specific existing list. Segments are dynamically updated over time as you add customers who meet the criteria of your segment, or as the traits of your contacts change. For example, a segment with the criteria "opened an email within 30 days" will evolve as contacts engage (or don't engage) with your email. Segmentation can be especially useful to ensure that you are targeting the best recipients for your campaign. ================================================ FILE: content/docs/glossary/sender-authentication.md ================================================ --- seo: title: Sender authentication title: Sender authentication weight: 0 layout: page navigation: show: false --- <call-out> In an attempt to clarify complex functionality, SendGrid is upgrading the name of Whitelabel. A whitelabel is now generally called sender authentication. A domain whitelabel is now called domain authentication. A link whitelabel is now called link branding. An IP Whitelabel is now called reverse DNS. </call-out> Sender authentication refers to the process of showing email providers that SendGrid has your permission to send emails on your behalf. To set up sender authentication, add DNS records to your hosting service. These DNS records associate your sending domain with SendGrid — when an inbox provider processes your email, they will see your domain instead of sendgrid.net. You can also set up sender authentication for the links in your email as well as dedicated IP addresses associated with your account (available with Pro level or higher accounts). ## Additional Resources - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ================================================ FILE: content/docs/glossary/sender-id.md ================================================ --- seo: title: Sender ID description: Sender ID is an email authentication standard developed by Microsoft that compares the email sender’s “From” address to the IP address to verify that it is authorized to send email from that domain. keywords: Sender ID, authentication, Sender Policy Framework, SPF title: Sender ID weight: 0 layout: page navigation: show: false --- Sender ID is an email authentication standard developed by Microsoft that compares the email sender’s “From” address to the IP address to verify that it is authorized to send email from that domain. To get more information please check out our [Email Infrastructure Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/senders.md ================================================ --- seo: title: Senders description: Senders in Marketing Campaigns provide identity information about where the emails are coming from for their recipients in campaigns in order to ensure all CAN-SPAM regulations are followed. keywords: title: Senders weight: 0 layout: page navigation: show: false --- [Senders]({{root_url}}/ui/account-and-settings/senders/) in Marketing Campaigns is required by CAN-SPAM regulations, and provide identity information about where the emails are coming from in each email you send. ================================================ FILE: content/docs/glossary/sends.md ================================================ --- seo: title: Sends description: Sends relate to your requests to deliver email to your recipients through SendGrid's API or UI, which you can schedule or retrieve aggregate data from. keywords: title: Sends weight: 0 layout: page navigation: show: false --- Sends relate to your requests to deliver email to your recipients through SendGrid's API or UI. We process the requests to send the email from you to your contacts and may encounter events such as deferred, delivered, blocked, and bounced when we attempt to deliver your email to the corresponding email service providers and email exchange servers. Once the recipient receives the email and interacts with it, more events will be captured such as clicks, opens, unsubscribes, spam reports, etc. We keep track of email events in the [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity/) and aggregate data in [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/). ================================================ FILE: content/docs/glossary/single-send.md ================================================ --- seo: title: Single Send description: A Single Send is a one-time email used to communicate a variety of nonautomated messages. keywords: Email, Marketing, Campaign, Promotion title: Single Send weight: 0 layout: page navigation: show: false --- A Single Send is a one-time nonautomated email message delivered to a list or segment of your audience. A Single Send may be sent immediately or scheduled for future delivery. Unlike an [automated email]({{root_url}}/glossary/automated-email/) series such as a [drip campaign]({{root_url}}/glossary/drip-campaign/), a Single Send is not part of a series of related messages that are designed to work in sequence. Single Sends can serve many use cases, including promotional offers, engagement campaigns, newsletters, announcements, legal notices, or policy updates. This means Single Sends are appropriate for both [transactional email]({{root_url}}/glossary/transactional-email/) and [promotional messages]({{root_url}}/glossary/email-marketing/). ================================================ FILE: content/docs/glossary/smtp-api.md ================================================ --- seo: title: SMTP API description: SMTP API is an API that allows you to tag your emails and provide customized email handling instructions on a per email basis. keywords: smtp api title: SMTP API weight: 0 layout: page navigation: show: false --- [SMTP]({{root_url}}/glossary/smtp/) stands for Simple Mail Transfer Protocol. SMTP allows software to transfer email over the internet. The term API stands for Application Programming Interface, which allows software to talk to each other. Therefore, the SMTP API allows two or more software platforms to talk to each other over the internet, based on a set of defined parameters and rules between systems. The SendGrid SMTP API gives developers the ability to customize email handling instructions using an X-SMTPAPI header. This JSON header is placed in each email message providing specific instructions on what to do with the email message. The customized header can be added to any SMTP message sent to SendGrid for interpretation by the receiver. There are two prime benefits to using the SMTP API. Since there are so many languages, frameworks, and mail clients, the SMTP API is the most flexible and simplest solution for delivering email. Secondly, SMTP API gives you advanced control over your email messages. You can tag or label your emails and set filters to define the type data you want to receive. You can create dynamic emails, automatically customize emails and add unique arguments using templates to make it easier to deliver your email efficiently. SendGrid makes it easy for customers to integrate their existing application with SendGrid in a few simple steps using SMTP. By changing your username, password, server host name and port connections, you can start sending email in a just a few minutes. The power of SMTP can be extended using our SMTP API which enables advanced functionality to take email management to the next level. You can use SendGrid’s SMTP API to perform tasks such as list management, open and click tracking, authentication, analytics integration, subscription management, and more. This is just one more way that SendGrid makes email delivery simpler and faster for developers. For more information about the SendGrid SMTP API, you can visit our [Documentation page]({{root_url}}/for-developers/sending-email/getting-started-smtp/). There, you’ll be able to learn how to use the API and implement the right headers to gain the statistics you need. In addition to our SMTP API, we also provide customers a Web API. Unlike the SMTP API, our [Web API]({{root_url}}/api-reference/) allows customers to retrieve information about their account and the messages they send to their recipient list. The Web API allows customers to see what messages are bounced back, what are reported as spam, and how many recipients unsubscribed from their email program. Finally, SendGrid also offers custom webhooks and other tools to give customers even more insight into their email programs. Some of our most versatile tools and apps include: * [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) – This webhook allows customers to automatically receive information about the performance of their email program through JSON posts to a url of their choosing. Event Webhook provides an easy way to track the status of messages and whether they have been delivered to specific email addresses. * [Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) – Rather than sending email from an address that doesn’t allow responses, customers can use the Parse Webhook to receive emails and even parse out the content and attachments. * [Reverse DNS]({{root_url}}/glossary/reverse-dns/) – If you’re sending email through SendGrid, reverse DNS allows you to remove the “sent via SendGrid” address in your messages, giving you a better sending reputation and removing SendGrid from the entire message. * [Transactional templates](https://sendgrid.com/dynamic_templates) – We created transactional templates to make creating different versions of templates easier for marketers and developers. With transactional templates, marketers can create and send email without the assistance of a technical person. ================================================ FILE: content/docs/glossary/smtp-provider.md ================================================ --- seo: title: SMTP Provider description: An email SMTP provider helps deliver large amounts of email from your server to the recipient’s server. keywords: smtp provider, smtp email provider title: SMTP Provider weight: 0 layout: page navigation: show: false --- An email SMTP provider is an email delivery vendor that uses Simple Mail Transfer Protocol ([SMTP]({{root_url}}/glossary/smtp/)) to send and receive email messages. Email messages traverse SMTP to relay your messages from your server to the recipient’s server so that it can be delivered and read by the end recipient. While some companies choose to set up and monitor their own SMTP server to send their email to subscribers, many are opting for a reliable SMTP provider to handle their email for them. An SMTP provider is a third party [email service provider](https://sendgrid.com) that will send (and ideally, deliver) your email on your behalf. This is particularly beneficial for senders who are sending large volumes of email to ensure proper handling, delivering, and monitoring of their marketing and transactional email streams. Using an SMTP provider has many benefits. Usually, SMTP providers, like SendGrid, are experts in the field of email delivery and will take proactive steps to ensure that email sent through their system follows the email best practices preferred by the ISPs and gets delivered. Secondly, an SMTP provider can bypass certain limits placed on individual senders, such as rate limits per hour or even volume limits, which can impact the success of your campaign. Lastly, the proper affiliation with an SMTP provider can reduce the probability that your emails will be [labeled as SPAM](https://sendgrid.com/blog/email-sending-spam-now/). An SMTP provider can also mediate with the ISPs and alert you to ongoing changes in the email landscape. Most importantly, an SMTP provider will deliver the right tools to help prevent, diagnose, and fix email delivery failures by allowing you to monitor what is going on with your email program. Email statistics such as delivery rates, response rates, and spam complaints can help you optimize your email campaigns for maximum email delivery and response. Plus, access to [email deliverability]({{root_url}}/glossary/deliverability/) experts through an SMTP provider can help supplement your team without taxing your internal resources or maintaining your own servers. SendGrid is an SMTP provider for both [transactional email](https://sendgrid.com/transactional-email) and [marketing email](https://sendgrid.com/email-marketing). We send billions of emails per month on behalf of senders across the globe. Our service is highly scalable, trusted, and reliable, enabling thousands of customers to communicate with their users effectively, efficiently, and without fail. Avoid the negative pitfalls that can come with email delivery by using SendGrid for automated and [bulk email sends]({{root_url}}/glossary/bulk-email-service/). When you become a SendGrid customer, we give you access to our [SMTP servers](https://sendgrid.com/blog/what-is-an-smtp-server/) so that you can send as many emails as you want. As you scale your company, we’ll monitor your sending reputation and inform you of any ISP policy changes to make sure your email is delivered. Some of the tools we provide you to take your company to the next level include: * Custom Apps and [Webhooks]({{root_url}}/for-developers/tracking-events/event/) – No matter what you want to track, we have the ability to show you who is opening your email, where your email is most successful, and who is reporting you as spam or unsubscribing from your recipient list. * [Industry Leading Customer Service](https://support.sendgrid.com/hc/en-us) – Our customer service team is capable of answering all your questions and helping you solve any problems that may arise with your email program. * Dedicated IPs – SendGrid allows you to take charge of your own sending reputation by giving you access to your very own IP. This means you won’t be affected by the actions of other companies’ sending habits. ================================================ FILE: content/docs/glossary/smtp-relay.md ================================================ --- seo: title: SMTP Relay description: An SMTP relay is used to send email between SMTP servers, when the servers are located on different domains. keywords: smtp relay, smtp relay service title: SMTP Relay weight: 0 layout: page navigation: show: false --- An email SMTP relay service is used every time you send an email to someone outside of your address’ domain. SMTP, or Simple Mail Transfer Protocol, does the heavy lifting of sending the message. The relay service moves the message from your email server to the email server of the recipient. It’s like the handoff of the baton in a relay race. A relay is not used when an email is sent between parties on the same domain, because there is only one server involved. However, if there are multiple domains involved between email messages, then a relay is required to deliver between each server. When you’re sending a large volume of email, that handoff—the SMTP relay—becomes very important. If you’re sending [marketing email](https://sendgrid.com/email-marketing) like newsletters or [transactional email](https://sendgrid.com/transactional-email) from your applications, you want to make sure that other servers trust that your server is sending good email. An email SMTP relay service is a trusted third party that adheres to sending best practices to help emails get delivered. In an effort to reduce spam, many internet providers will limit the amount of SMTP relays it will conduct each day. This means that a business that sends large amounts of email may get their legitimate emails categorized as spam. Even a peer-to-peer email server will experience this when sending bulk email messages. An SMTP relay service provider can help prevent this deliverability problem and ensure that your emails get to the inbox. SendGrid provides SMTP relay services for both transactional email and marketing email. Because we send billions of emails per month, our service is highly scalable, trusted, and reliable. Avoid the negative pitfalls by using SendGrid for automated and bulk email sends. ================================================ FILE: content/docs/glossary/smtp-server.md ================================================ --- seo: title: SMTP Server description: SMTP server (Simple Mail Transfer Protocol) is an applications used to send email and react to response codes from receiving servers. keywords: smtp server title: SMTP Server weight: 0 layout: page navigation: show: false --- An SMTP server is used to send email. Though server is in the name, they do not necessarily reside on an entire machine. Rather, an [SMTP server is an application](https://sendgrid.com/blog/what-is-an-smtp-server/) that runs all the time awaiting new mail to send. Email is sent using SMTP—Simple Mail Transfer Protocol. At its most basic, an SMTP server must speak this protocol. Modern SMTP servers must also consider methods for authenticating, such as DKIM and SPF. Authenticating email is one of the best ways to signal to receiving servers that the email you are sending is legitimate. When sending large amounts of email, SMTP servers need to be able to react intelligently to response codes from receiving servers. Some email providers, such as Yahoo! Mail and AOL, will throttle the number of emails they allow through at a time. In that case, the servers return error codes to note temporary unavailability. Throttling can pose a significant deliverability problem for applications sending [transactional emails](https://sendgrid.com/transactional-email) (emails triggered by a user’s interaction with a web application, such as password changes or purchase receipts). In these instances, a business or app is not relaying the vital information their users expect, because their SMTP servers cannot react to the error response codes. When this happens, email deliverability rates drop, affecting customer satisfaction and retention. SendGrid wrote its own SMTP servers from scratch to efficiently send billions of emails per month. SendGrid customers all receive email authentication and SendGrid automatically reacts to throttling and other responses from receiving servers. For better deliverability, SendGrid automatically works with every email provider’s feedback loops to identify spam. SendGrid customers also have access to detailed analytics of all email sent through its SMTP servers. ================================================ FILE: content/docs/glossary/smtp-service.md ================================================ --- seo: title: SMTP Service description: An SMTP service ensures delivery of your email at scale. keywords: smtp service, smtp email service, smtp email delivery service title: SMTP Service weight: 0 layout: page navigation: show: false --- An SMTP service makes it easy for developers to send email from their applications. Most modern programming languages have libraries to send email via SMTP, or Simple Mail Transport Protocol. An SMTP service provides an external mail server and has tremendous advantages over using an in-house server or one made available by a hosting provider. When developers send emails, they want to make sure the message is delivered. An SMTP service’s biggest value is deliverability. Though it’s not always possible to know whether a message has hit the inbox, following industry best practices increases deliverability. An SMTP service’s features should enable developers to follow best practices, such as removing unsubscribes, [bounced addresses](https://sendgrid.com/blog/email-bounce-management/), and spam reports. Further, it should be easy to trim a list’s unengaged recipients. Though developers themselves can make a difference in deliverability, some responsibility is also on the SMTP service. Many cloud web hosting providers have had their email servers denied, usually due to abuse or threat of abuse. An SMTP service should maintain relationships with popular ISPs to [avoid ending up on deny list]({{root_url}}/glossary/deny-list/). Working with ISPs involves setting up [structured feedback loops](https://sendgrid.com/blog/email-feedback-loops-top-4-tips-on-how-to-use-them/) to receive spam reports. Another benefit of an SMTP service is scalability. As email programs grow, so do the cost and complexities of maintaining an in-house infrastructure. By using an SMTP service, developers can focus on developing their product instead of on email delivery maintenance. SendGrid’s SMTP service is responsible for 2% of the world’s non-spam email. It provides multiple methods to send email directly using SMTP and also via a Web API with libraries for all popular programming languages. SendGrid’s advanced statistics and analytics give developers all the data they need to follow industry best practices while maintaining visibility into how their emails are performing. Lastly, SendGrid’s excellent support and compliance teams ensure a happy relationship with both ISPs and customers. ================================================ FILE: content/docs/glossary/smtp.md ================================================ --- seo: title: SMTP description: SMTP is an acronym for Simple Mail Transfer Protocol. SMTP is a process and set of guidelines for sending email. keywords: smtp, simple mail transfer protocol, smtp email title: SMTP weight: 0 layout: page navigation: show: false --- For most people, sending an email is as simple as entering an email address, writing a message, and hitting “send;” a few minutes later, the same message arrives in the recipient’s inbox. What you may not know, however, is that there is an entire process a message needs to go through for this to happen. SMTP is an acronym for Simple Mail Transfer Protocol. SMTP is a process and set of guidelines that almost every email needs to go through in order to leave one outbox and arrive at another person’s inbox. ## How SMTP Works Once you’ve composed and sent an email, it no longer appears as the sleek interface you see when you look at Gmail, Yahoo!, or Outlook. After hitting “send,” your email is transformed into a long string of plain text that contains information like timestamp, sender, recipient, heading, and message body. This string of code is sent to an SMTP server. An [SMTP server]({{root_url}}/glossary/smtp-server/) is a constantly-running application that speaks SMTP. The server decodes your email, determines which server the message must be sent to for your recipient to retrieve it, and relays the message there. After the message has been relayed to the next server, the recipient’s email provider, like Yahoo! or Gmail, downloads the message and delivers it to the appropriate inbox. ## Why is SMTP Important? SMTP is important because it provides a common set of guidelines for messages to be transferred from one email host to another. Essentially, SMTP is the only way any email can be sent from one provider to another without losing any of the content or functionality. While sending one email is fairly simple, for larger organizations that send thousands or millions of [marketing](https://sendgrid.com/email-marketing) or [transactional email](https://sendgrid.com/transactional-email), the SMTP process can get much more complicated, requiring [SMTP relay service](https://sendgrid.com/blog/smtp-relay-service-basics/) and custom headers for multiple recipients. If you have any SMTP questions, or if you want to know more about how SendGrid uses SMTP to send billions of email every month, contact the [SendGrid support](https://support.sendgrid.com/hc/en-us) team today. ================================================ FILE: content/docs/glossary/spam-filter.md ================================================ --- seo: title: Spam Filter description: Software based email filters that look for spam and block it from going to the inbox. keywords: spam, spam filter, block, email, email spam filter title: Spam Filter weight: 0 layout: page navigation: show: false --- <call-out> If you discover spam that was sent by a SendGrid customer, please [report it to our team](https://sendgrid.com/report-spam/). We appreciate your help in keeping our email stream clean. </call-out> Spam Filters are software based email filters that block email on a range of attributes from words or phrases within the email to header information and other factors. The goal is to identify spam before it is delivered to the inbox. Spam filters typically will move the messages they find to the [spam folder]({{root_url}}/glossary/bulk-mail-folder/) within the user's respective email application, keeping that email out of the user's inbox entirely. To get more information please check out our [Email Infrastructure Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/spam-reports.md ================================================ --- seo: title: Spam Reports description: Spam Reports are triggered when a customer clicks the spam button in their email client. keywords: spam report, spam reports title: Spam Reports weight: 0 layout: page navigation: show: false --- <call-out> If you discover spam that was sent by a SendGrid customer, please [report it to our team](https://sendgrid.com/report-spam/). We appreciate your help in keeping our email stream clean. </call-out> Spam Reports are triggered when a customer clicks the spam button or puts your email in their [spam folder]({{root_url}}/glossary/bulk-mail-folder/) within their email client such as Yahoo, Outlook or AOL. Spam reports can only be gathered from Internet Service Providers (ISPs) that provide a Feedback loop. It is important that spam reporter email addresses are permanently removed from your send list even if the customer has previously opted in. Continuing to send to customers that have reported your email as spam can severely affect your deliverability rating. <call-out> Make it easier for someone to find the unsubscribe button than it is to find the spam button. </call-out> <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/spam-traps.md ================================================ --- seo: title: Spam Traps description: A SPF is an email authentication standard that helps ISPs better identify legitimate email senders. keywords: spam trap, spam, honeypot, spamtrap title: Spam Traps weight: 0 layout: page navigation: show: false --- <call-out> If you discover spam that was sent by a SendGrid customer, please [report it to our team](https://sendgrid.com/report-spam/). We appreciate your help in keeping our email stream clean. </call-out> Spam traps, also called “honeypots”, are email addresses created (or re-activated) by ISPs specifically to lure spammers. In many cases, the only way to acquire the address is through an automated email address harvesting process. Spam traps are important because so many large ISPs, spam filter providers, and Domain Name System [deny lists]({{root_url}}/glossary/deny-list/) use them. In short, sending an email to a spam trap can lead directly to being blocked by the organization that set up the trap. Remember that blocking can ruin a business’s reputation and halt further email deliverability. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ================================================ FILE: content/docs/glossary/spam.md ================================================ --- seo: title: Spam title: Spam weight: 0 layout: page navigation: show: false --- <call-out> If you discover spam that was sent by a SendGrid customer, please [report it to our team](https://sendgrid.com/report-spam/). We appreciate your help in keeping our email stream clean. </call-out> The most simple way to define spam in the Email world is by using these 2 words: `unwanted email`. Since it’s so easy for a message to fall in this category, as a Sender you may want to know how and why emails can get marked as spam. These are some of the most common reasons for which an email may end up in the Spam Folder and ways to avoid this: 1. **Improper authentication**: Authentication is extremely important as it helps ISPs identify you as a sender. Think of it as knocking on someone’s door. You want to inspire trust in order to get invited in their home. In the email world you can do so by making sure your email server supports these protocols ([DKIM, Domain Keys]({{root_url}}/glossary/dkim/), [SPF]({{root_url}}/glossary/spf/), and [Sender ID]({{root_url}}/glossary/sender-id/)) and that they are properly implemented. SendGrid ensures authentication by setting up DKIM and SPF records automatically for you. For Pro 100k or above packages, we offer dedicated IPs which can be [authenticated]({{root_url}}/ui/sending-email/how-to-set-up-domain-authentication/) with your sending domain and therefore strengthening the authentication. 2. **High complaint rate**: If too many people are flagging your mail as spam, ISPs will take action and will first start sending your mail to the Spam Folder, then they may start throttling your messages or even block them. Keeping an eye on the complaint rate is critical if you want to reach the Inbox. 3. **Lack of an Unsubscribe Link**: It is important to give customers the choice to opt out of a service. Not adding an Unsubscribe link to emails will force a subscriber to hit the Spam button in order to stop receiving emails from a Sender. Avoid this by adding an opt-out link to your emails. Some studies have shown that you can lower the complaint rates by simply placing the Unsubscribe link at the top of your emails and making it visible, easy to find. 4. **High Frequency**: This is the number one reason subscribers either hit the Spam Button or Unsubscribe from an email stream. ISPs want to make sure that their users’ mailboxes don’t get crowded and in order to protect their users from email fatigue they can start junking the messages. To avoid this, the best way to go about it is to simply include a link to your [Email Preference Center](https://sendgrid.com/blog/need-email-preference-center/) in your emails. This way you let your subscribers tell you how often they want to hear from you. 5. **Sending to inactive users**: People’s interests change all the time and so it happens with emails. Subscribers can lose interest and stop opening the emails. The most common tendency is to send emails to even more users. However, this will only hurt your deliverability even more because ISPs have ways of monitoring the activity of the users. They can check whether users open the emails, click on links, and delete or mark emails as spam or not spam. Basically, they monitor the users’ level of responsiveness or engagement. Based on these metrics, ISPs decide folder placement - whether the email goes to the Inbox or if it gets Junked. The only way to avoid hitting the Spam Folder is by tracking [user engagement](https://sendgrid.com/blog/email-reputation-and-email-engagement-metrics/). For all users, SendGrid offers the [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) to help with that. [Here](https://sendgrid.com/blog/infer-engagement-with-the-event-api/) is our recommendation on how to use the Event Webhook in tracking your customers' responsiveness to your emails. The key part in tracking user engagement is an appropriate [sunset policy](https://sendgrid.com/blog/putting-engagement-data-use-sunset-policies/) for your business. Before removing the inactive users from your distribution lists, it is worth trying to reengage them. One great way to do that is by sending them [reconfirmation campaigns]({{root_url}}/glossary/reconfirmation/). 6. **Inadequate content**: It is well known that the ISPs are protecting their users with the help of spam filters. Using the wrong words or even characters in your email can trigger the spam filters and therefore throw your email in the Spam Folder. The key thing to remember, is that a spam filter is trying to remove commercial advertisements and promotions. So generally, words that are common in such emails should be avoided or used sparingly. That said, take a look at these [100 Spam Trigger Words & Phrases to Avoid](http://blog.hubspot.com/blog/tabid/6307/bid/30684/The-Ultimate-List-of-Email-SPAM-Trigger-Words.aspx). To find out more about what you can do to ensure your email is being received by your recipients, you may also want to check out our [Tips and Tricks to Stay Out of the Spam Folder](https://sendgrid.com/blog/tips-tricks-stay-spam-folder-qa/). <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ## Additional Resources - [Spam Filter]({{root_url}}/glossary/spam-filter/) - [Spam Reports]({{root_url}}/glossary/spam-reports/) - [Spam Trap]({{root_url}}/glossary/spam-traps/) - [Spam]({{root_url}}/glossary/bayesian-filter/) ================================================ FILE: content/docs/glossary/spf.md ================================================ --- seo: title: SPF description: SPF is an email authentication standard that helps ISPs better identify legitimate email senders. keywords: spf, sender policy framework title: SPF weight: 0 layout: page navigation: show: false --- Sender Policy Framework (SPF) is an open standard for authenticating email that was originally developed by AOL. SPF attempts to ensure that the IP address from which a message was sent is approved to send email by a domain’s owner. Imagine you own the domain `example.com`. You also have an email server that uses the IP address `127.0.0.1`. You may use an SPF record to designate this IP address, `127.0.0.1`, as the only IP allowed to send email using an `example.com` email address. When an email server receives a message from `sender@example.com`, it can check the IP address that delivered the message. If the IP is anything other than `127.0.0.1`, the SPF check will fail, informing the receiving server that the message is from an unauthorized source. ## SPF Records An SPF record is implemented using a [TXT](https://en.wikipedia.org/wiki/TXT_record) DNS record. The TXT record has several values, the first being `v=spf1`. This first value indicates that the TXT record is a version 1 SPF record. The remaining mechanisms in an SPF record are "INCLUDE," "A," "MX," "IP4 and IP6," and "REDIRECT." These mechanisms specify either an approved IP address directly or a domain that will resolve to an IP address. SPF is one of several effective ways to check an email’s legitimacy, and this article provides only a brief overview. For more information about SPF, see [SPF Records Explained]({{root_url}}/ui/account-and-settings/spf-records/). ================================================ FILE: content/docs/glossary/spoofing.md ================================================ --- seo: title: Spoofing description: Spoofing is a technique where forged email addresses are used to trick recipients into opening an email because the source has been hidden keywords: spam, phishing, spoofing title: Spoofing weight: 0 layout: page navigation: show: false --- Email spoofing is the practice of sending email with a forged From address, and it's one tactic used to deliver potentially dangerous messages. Because a spoofed email looks to be from a legitimate contact, spoofing is often used in [phishing]({{root_url}}/glossary/phishing/) emails that aim to extract personal data from recipients. Unfortunately, spoofing a From address is relatively easy because email has no built-in authentication mechanisms. To combat spoofing, several standards have been developed including, [Sender Policy Framework (SPF)]({{root_url}}/glossary/spf/), [DomainKeys Identified Mail (DKIM)]({{root_url}}/glossary/dkim/), and [Domain-based Message Authentication, Reporting and Conformance (DMARC)]({{root_url}}/glossary/dmarc/). To understand spoofing, you should also know that an email actually has two From addresses. There is the Header From or _friendly_ from address and the Envelope From or `return-path` address. ## Header From The Header From or friendly From address is the one displayed in the **From** field of your email client. This From address is less important for directing email traffic. Think of the Header From address like the address on the letterhead of paper correspondence—the postal service **does not** use this address to route mail; it’s there as a _friendly_ bit of information for the reader. Spoofing the Header From address places false information in the **From** field of your email client, and it's called display name abuse. Display name abuse is a user interface change that isn’t handled by common methods of spoofing protection such as SPF, DKIM, and DMARC. ## Envelope From The Envelope From address informs receiving email servers where to deliver replies and where to send [bounces]({{root_url}}/glossary/bounces). Think of the Envelope From as the return address on a paper letter’s envelope—the postal service **does** use this address to route mail; it’s there to establish the sending source of the letter. For email, you can find the Envelope From address in your email client by selecting "Show Original," "View Message Source," "Show Headers," or a similar option depending on your email client. The Envelope From is not usually displayed to a message’s recipient by default. When we discuss spoofing in relation to SPF, DKIM, and DMARC, we are talking about attempts to prevent spoofing the Envelope From or `return-path` address. Because spoofing this address can route your replies, and any sensitive information they contain, to a bad actor, a lot of effort has gone into the standards listed above to prevent email abuse. For more information about how these standards work, see the articles listed in the [Additional Resources](#additional-resources) section of this page. ## Reporting Email Abuse SendGrid works hard to keep our email stream clean. Despite our best efforts, spam does occasionally leak through our defenses. If you discover spam that was sent by a SendGrid customer, please report it to our team by sending it to abuse@sendgrid.com or opening a ticket with [SendGrid Support](https://support.sendgrid.com/hc/en-us). No matter who sent the phishing email, you can file a report with the [Federal Trade Commission](http://www.ftc.gov/complaint). If we find that a SendGrid customer is sending spoofed or phishing emails, we will ban their account immediately ## Additional Resources - [DKIM Records Explained]({{root_url}}/glossary/dkim/) - [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) - [SPF Records Explained]({{root_url}}/ui/account-and-settings/spf-records/) - [Email Infrastucture Guide](https://sendgrid.com/resource/the-email-infrastructure-guide-build-it-or-buy-it/) ================================================ FILE: content/docs/glossary/subscriber-list-management.md ================================================ --- seo: title: Subscriber List Management description: Managing your subscriber list is key to keeping your subscribers happy. keywords: subscriber list management, unsubscribes, email lists title: Subscriber List Management weight: 0 layout: page navigation: show: false --- Maintaining good list management is a key element in keeping your users happy. Sending email to someone who has unsubscribed or never signed up in the 1st place is a big no-no in the email game. Make sure to check your list statistics. You can do this in [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) by clicking on the stats button next to your recipient list name. You can also [manage your unsubscribes]({{root_url}}/ui/sending-email/index-suppressions/) by clicking the manage unsubscribes button next to your recipient list name. Make sure you are sending mail to people who actually want your mail. Otherwise, you will get lots of [spam reports]({{root_url}}/glossary/spam-reports/), [blocks]({{root_url}}/glossary/blocks/) and [bounces]({{root_url}}/glossary/bounces/). Finally, make sure you do not buy email lists or engaging in [Email Harvesting]({{root_url}}/glossary/email-harvesting/). For tips on getting your messages to the Inbox, please see our [email deliverability]({{root_url}}/ui/sending-email/deliverability/) page. ================================================ FILE: content/docs/glossary/suspicious-sender.md ================================================ --- seo: title: Suspicious Sender description: A suspicious sender is a sender who sends email to recipients who have not given them express permission to do so. title: Suspicious Sender weight: 0 layout: page navigation: show: false --- A suspicious sender (some services use the term "black hat sender") is a sender or company who sends email to recipients that didn't specifically request to receive emails from that sender. It is somebody that sends unsolicited emails to recipients that never requested them. Not all suspicious activity is intentional though. Even senders who have their recipient's permission but send an excessive amount of email or who send at an alarming frequency may be flagged by users as “spam." These senders will be identified by the recipient's ISP, which may throttle the sender's email, send it to spam traps, or totally block the emails. If your emails are not getting the clicks and opens you expect, you may want to re-evaluate your sending habits. Also, please take a look at our [email deliverability tips]({{root_url}}/ui/sending-email/deliverability/) for help in being a trusted sender. For more information: * [Email Harvesting]({{root_url}}/glossary/email-harvesting/) * [Trusted Sender]({{root_url}}/glossary/trusted-sender/) ================================================ FILE: content/docs/glossary/system-fields.md ================================================ --- seo: title: System Fields description: System fields are available in the campaign builder that allow you to insert specific content into your campaign, such as web links, unsubscribe links, or links to your campaign's subscription preferences page. These system substitution tags are not related to your contact data and should not be confused with reserved or custom fields. keywords: title: System Fields weight: 0 layout: page navigation: show: false --- [System Fields]({{root_url}}/ui/sending-email/editor/#using-subustitution-tags), also known as Subsitution Tags are available in the campaign builder that allows you to insert specific content into your campaign, such as web links, unsubscribe links or links to your campaign's subscription preferences page. These system substitution tags are not related to your contact data and should not be confused with reserved or [custom fields]({{root_url}}/glossary/custom-fields/)custom fields. ================================================ FILE: content/docs/glossary/teammates.md ================================================ --- seo: title: Teammates description: Manage multiple users on one SendGrid account. keywords: teammates, permissions, access, user access, multiple users title: Teammates weight: 0 layout: page navigation: show: false --- [Teammates]({{root_url}}/ui/account-and-settings/teammates/) is an account administration and security tool designed to help manage multiple users on a single SendGrid account. Teammates is built for groups of shared users, where each user has a different role and thus requires access to different SendGrid features. A marketer, developer, and accountant would each have their own teammate account under one SendGrid parent account. The parent SendGrid account will always have administrator level teammate permissions, and may grant any or all of these permissions to other teammates. As an example of role specific permissions, the marketer would be given the following levels of access: - [Alerts]({{root_url}}/ui/account-and-settings/alerts/) - Full Access - [Category Management]({{root_url}}/ui/analytics-and-reporting/categories/) - Read Access - [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - Read Access - [Mail Send: Scheduled Sends](https://sendgrid.api-docs.io/v3.0/mail-send) - Read Access - [Mail Settings: Spam Checker]({{root_url}}/ui/account-and-settings/mail/#spam-checker) - Full Access - [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - Full Access - [Stats]({{root_url}}/ui/analytics-and-reporting/stats-overview/) - Read Access - [Suppressions]({{root_url}}/ui/sending-email/index-suppressions/) - Full Access - [Template Engine]({{root_url}}/ui/sending-email/create-and-edit-legacy-transactional-templates/) - Full Access - [Tracking]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - Full Access ================================================ FILE: content/docs/glossary/throttling.md ================================================ --- seo: title: Throttling description: Learn more about deferrals and throttling keywords: deferred, deferral, throttling, bounce, block title: Throttling weight: 0 layout: page navigation: show: false --- So, you tried to send a bunch of emails, and when you checked your [Event Webhook]({{root_url}}/for-developers/tracking-events/event/) or your [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) page, you see a number of messages are marked as "Deferred" instead of "Delivered". Or maybe you're noticing a lot of addresses in your [Blocks](https://app.sendgrid.com/suppressions/blocks), but not many in your Bounces. What? Why aren't your recipients currently in awe at the glory of your amazing message? SendGrid continues to attempt to send messages for up to 72 hours or until successful delivery. Normally, it takes between a few minutes and a few hours for a deferred messages successful delivery - it depends on the receiving mail server. Throttling is when a receiving server refuses a message, but with a specific explanation that tells our server that it's only a temporary refusal. The error is usually something like "user is receiving mail at too great a rate right now, please try again later", or "user's mailbox is over quota." These errors are most often 400 errors - indicating a temporary failure. They are not often 500 errors - indicating a permanent failure. ## What causes a deferral? - The receiving server doesn't recognize your IP, and may think you're sending spam. This is why [warming up your IP]({{root_url}}/ui/sending-email/warming-up-an-ip-address/) is so important. IP Warmup allows recipient mail servers to become familiar with your sending habits, and later anticipate your messages. - The receiving server doesn't have any open ports to receive email. - The recipient's mailbox is full. - Some recipients have marked your mail as spam, but not enough for the server to block you. Instead, they will refuse to receive more until they can learn more about how their users interact with your messages. If a message is continuously deferred for 72 hours, it may mean that there is another issue such as the account being inactive, a full mailbox, or some other legitimate problem with the recipient. When we are unable to deliver a message after this time period, we convert these deferrals to "Blocks". Blocks are stored for reference and do not behave like a suppression list when sending to addresses that are on the list. ================================================ FILE: content/docs/glossary/timezone.md ================================================ --- layout: page weight: 0 title: Timezones navigation: show: false seo: title: Timezones override: true description: Local time, based on your current geographic location on the earth. --- Timezones can be a tricky thing to wrangle, because depending on where you normally work and what your current local time is, you may come across times that don't always work with what you're expecting. When you create your SendGrid account, you will set the timezone for your account in your profile. This timezone will be used for times displayed in the SendGrid UI and for scheduling Marketing Campaigns. When you use the API or look at event listings, you may notice something that you receive numbers. These numbers are a [Unix Timestamp](http://en.wikipedia.org/wiki/Unix_time), which basically means the number of seconds since "00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970". If for some reason you are running into timezone issues with scheduling Marketing Emails, please remember that you have the option to specify a timezone when you schedule the email to go out. If you don't specify the timezone, it will default to current Pacific Time (UTC-7 or UTC-8, depending on daylight savings time). When viewing the campaigns, you may notice that the times say something like "Sent on 8:35 AM UTC -0700". This means that the campaign was sent at 8:35am in the "UTC -0700” timezone (aka MST or PDT) not at 8:35am minus 7 hours. ================================================ FILE: content/docs/glossary/tls.md ================================================ --- layout: page weight: 0 title: Transport Layer Security navigation: show: false seo: title: Transport Layer Security override: true description: Protect transmission of email information with TLS and SendGrid --- Transport Layer Security (TLS) is an encryption protocol that’s used to encrypt information in transit over the Internet. TLS uses certificates to encrypt sessions to maintain confidentiality of information. SendGrid uses TLS to encrypt sessions with its application via HTTPS and API. SendGrid also utilizes “opportunistic TLS” for sending email via [SMTP]({{root_url}}/glossary/smtp/) or our [Web API](https://sendgrid.api-docs.io/v3.0/mail-send). Opportunistic TLS means that we will encrypt your email sending from your end point all the way to the recipient, providing that the recipient’s mail server is configured to support TLS. Using TLS is increasingly important to protect your privacy and the privacy of your recipients, and to prevent online surveillance. For more background on opportunistic TLS, read our blog post on the [Future of Email Security](https://sendgrid.com/blog/sendgrid-and-the-future-of-email-security/). For information on configuring your system to utilize TLS, see our information on setting up your server for sending email. ================================================ FILE: content/docs/glossary/transactional-email-templates.md ================================================ --- seo: title: Transactional Email Templates description: Transactional email templates are pre-coded email layouts that anyone can use to easily create and send transactional emails. keywords: transactional email templates, email template, template engine title: Transactional Email Templates weight: 0 layout: page navigation: show: false --- Transactional email templates are pre-coded email layouts that marketers, designers, and developers can use to quickly and easily create transactional email campaigns. SendGrid’s transactional email templates allow non-technical and technical people alike to make real-time changes to the email their recipients receive. In the past, creating an email required marketers to work with designers and developers to develop the final message received by recipients. The SendGrid transactional template editor relieves a lot of this work by providing marketers and designers with various email layouts they can use within The SendGrid UI. This frees up developers to focus on more important projects, while the marketers can easily create and send their emails. SendGrid's [transactional templates](https://sendgrid.com/templates) give each user the ability to create their own templates for each of the transactional emails they need to send. Different email templates can be created, saved, and edited for purchase receipt emails, account notification emails, or password reset emails. ## Using Transactional Templates Transactional templates allow users to modify their content via WYSIWG or HTML. They also allow users to preview how transactional email templates will look on both [mobile and desktop platforms](https://sendgrid.com/blog/5-tips-designing-email-for-mobile/). The email experts have also created a few [responsive email templates](https://sendgrid.com/blog/responsive-templates-make-sure-everyone-can-read-email/) so that you can make sure your messages look great on any device. The transactional templates design section allows marketers to easily design a template, without the need for complex coding. Developers can then manage multiple templates created with a RESTful API and integrate them into applications. To learn more about the SendGrid transactional email templates, you can visit the [technical documentation]({{root_url}}/ui/sending-email/create-and-edit-legacy-transactional-templates/), or the [API Reference](https://sendgrid.api-docs.io/v3.0/transactional-templates) By using SendGrid's transactional template application, marketers can maintain control of their email design while enjoying the strong [email deliverability]({{root_url}}/glossary/deliverability/) that SendGrid provides. They can create a vast array of different email templates, all with the confidence of knowing their emails will reach the inbox. [Contact the SendGrid support team](https://sendgrid.zendesk.com/hc/en-us) if you have any questions about implementing and using transactional templates or visit our blog to learn more about [marketing and transactional email best practices](https://sendgrid.com/blog/marketing-and-transactional-email-best-practices-checklist-2/). ================================================ FILE: content/docs/glossary/transactional-email.md ================================================ --- seo: title: Transactional Email description: Transactional Emails represent the emails which are triggered by a user interacting with a web application. keywords: transactional email, transactional emails, transactional email service title: Transactional Email weight: 0 layout: page navigation: show: false --- Transactional email is relationship content that “facilitates an already agreed-upon transaction or updates a customer about an ongoing transaction.” It includes any email triggered by a user’s interaction with a web application, such as: * Account Signups * Password changes * Purchase Receipts * Check-ins * Notifications * Friend/follower requests These emails typically contain information a user wants or needs and consequently have the highest open rates across all categories of email. Because transactional email is so desired, you want to make sure that it consistently reaches your customers’ inboxes. In order to ensure strong email deliverability, rely on a trusted cloud-email service like SendGrid. SendGrid’s [transactional email platform](https://sendgrid.com/transactional-email) provides: * Robust email deliverability features: including authentication, reputation monitoring, dedicated IP addresses, and more * Easy Integration: through flexible web and SMTP APIs plus a simple SMTP relay set-up * Real-time analytics and reporting: including open, click, bounce, unsubscribe tracking, and more * Live Customer Support: 24/7 email, phone, and chat support Transactional email is an incredibly effective communication tool that can help drive revenue, reduce support costs, and build customer loyalty. As the most desired and expected form of email communication, transactional email can help grow your business and should be an integral component of any customer communication program. To make sure you're sending the most effective Transactional email, make sure you are building a good email with a good visual, concise content, and appropriate headers. Here are a few good "tools" you can use to get the most out of your Transactional email sending: A good visual email means the email shows up in a clear and appealing manner to the consumer. Concise content means the email is formatted clearly and there is a good ratio of text, hyperlinks, and pictures. To check your code for these Transactional emails, check out the API library in your preferred programming language from our [API Reference Index]({{root_url}}/api-reference/). The [SMTPAPI header]({{root_url}}/Utilities/smtpapi_validator.html) will validate the header you've used for SMTP API and the [SendGrid List Management Tools]({{root_url}}/ui/managing-contacts/managing-contact-list/#managing-your-list) will help you update your email list to get the best deliverability. ================================================ FILE: content/docs/glossary/triggered-actions.md ================================================ --- seo: title: Triggered Actions description: Triggered Actions are initiated by a triggering event. keywords: automated email, triggered actions, triggering events, Threads title: Triggered Actions weight: 0 layout: page navigation: show: false --- Triggered actions are automatically initiated when a specific [triggering event]({{root_url}}/glossary/triggered-actions/) that you are tracking takes place. These actions must be defined in advance, and they must be associated with a predetermined user and event. SendGrid has partnered with [Klaviyo](https://sendgrid.com/partners/klaviyo/) to help you drive sales by using data to send triggered email, segment your lists, run better Facebook ads, and more. An example of a triggered action might be an email message (or series of messages) welcoming a new user to your website or application. <call-out> To learn more about the different actions that Klaviyo can provide visit their [website](https://www.klaviyo.com/). </call-out> ================================================ FILE: content/docs/glossary/triggered-email.md ================================================ --- seo: title: Triggered Email description: Triggered emails are another name for automated emails that are triggered by specific events or actions. keywords: automated email, triggered email, Threads, triggering event, event title: Triggered Email weight: 0 layout: page navigation: show: false --- Triggered email is another term for email automation, or [automated email]({{root_url}}/glossary/automated-email/). <call-out> Interested in sending automated email? SendGrid Automation is a new offering that's currently in beta among select users. [Visit SendGrid.com](https://sendgrid.com/solutions/marketing-automation/?utm_source=docs) to learn more and be added to the waitlist. </call-out> ================================================ FILE: content/docs/glossary/trusted-sender.md ================================================ --- seo: title: Trusted Sender description: A trusted sender is a sender who only sends email to those recipients who have given them express permission to do so. title: Trusted Sender weight: 0 layout: page navigation: show: false --- A trusted sender (some services use the term, "white hat sender") is a sender or company who only sends email to those recipients who have given express permission to receive email from the sender. Put simply, trusted senders always strive to “send the right message, to the right person, at the right time, with the right frequency.” SendGrid has a plethora of resources to help you be a trusted sender, and to get your email to the inbox and not the spam folder. Check out our [email deliverability]({{root_url}}/glossary/deliverability/) tips to help. ## Additional Resources * [Bulk Email Folder]({{root_url}}/glossary/bulk-mail-folder/) * [Email Deliverability]({{root_url}}/glossary/deliverability/) * [Sender Authentication]({{root_url}}/glossary/sender-authentication/) * [Suspicious Sender]({{root_url}}/glossary/suspicious-sender/) ================================================ FILE: content/docs/glossary/two-factor-authentication.md ================================================ --- seo: title: Two Factor Authentication description: Multi-factor Authentication requires the user to have some information that only they could have to log into an account. keywords: 2FA, Two Factor Authentication, Multi-factor Authentication, two step verification title: Two Factor Authentication weight: 0 layout: page navigation: show: false --- Two-Factor Authentication (also known as Multi-factor authentication, 2FA, two step verification, or TFA) is an extra layer of security enforced during authentication that requires not only a password and username but also something that only that user has on them, that is a piece of information only they should know or have immediately at hand such as a physical token, a phone application, or a device. <call-out type="warning"> SendGrid no longer accepts Basic authentication for API calls when two-factor authentication is enabled for a user. You can now only use two-factor authentication if you are authenticating with an API key. For more information, see [Authentication]({{root_url}}//for-developers/sending-email/authentication/). </call-out> With SendGrid, you can turn this security feature on in your [Account Settings]({{root_url}}/ui/account-and-settings/two-factor-authentication/). ## Additional Resources - [Two-Factor Authentication FAQ]({{root_url}}/ui/account-and-settings/two-factor-authentication/) ================================================ FILE: content/docs/glossary/undelivered-email.md ================================================ --- seo: title: Undelivered Email description: Email can be undelivered for various reasons, including an issue with email address or content. title: Undelivered Email weight: 100 layout: page navigation: show: false --- Undelivered email can be the result of several things but most commonly there is an issue with the email address or content. Once an email send has been attempted but failed, a couple things can happen to your email: * Bounced emails are ones that were rejected by the recipient's server * Invalid emails were sent to email addresses that do not exist * Emails can be marked as [spam]({{root_url}}/glossary/spam/) by the recipient for various reasons * An email is [Dropped]({{root_url}}/glossary/drops/) when the recipient is on a [suppression list]({{root_url}}/ui/sending-email/index-suppressions/) <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/glossary/unknown-user.md ================================================ --- seo: title: Unknown User description: Bounced - Unknown User is an error indicating the email address does not exist. keywords: unknown, user, bounce, undelivered, email title: Unknown User weight: 0 layout: page navigation: show: false --- If an email address (user) does not exist at the organization or domain, it will receive Unknown User response (a hard bounce error). An Unknown User response is typically due to SMTP 5.5.0 errors which cause an email to be undeliverable to an inactive, incorrect, or disabled recipient address. ### Additional Resources * [Delivery Metrics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) * [Bounces]({{root_url}}/glossary/bounces/) * [Subscriber List Management]({{root_url}}/glossary/subscriber-list-management/) ================================================ FILE: content/docs/glossary/utm-parameters.md ================================================ --- layout: page weight: 0 title: UTM Parameters group: glossary seo: title: UTM Parameters description: Defintion of UTM Parameters keywords: navigation: show: false --- ## UTM Parameters UTM parameters are tags that you add to a URL to gain better visibility into your web analytics. When a user interacts with your link, data is sent to Google Analytics so that you can track and monitor your traffic. For example, a UTM parameter can help determine which social media campaign brought the most web traffic or which call to action in an ad generated more purchases. ================================================ FILE: content/docs/glossary/web-api.md ================================================ --- seo: title: Web API description: Web API allows web servers and web browsers to easily interface with each other to enable account and data collection for services such as email. keywords: web api, web api integration title: Web API weight: 0 layout: page navigation: show: false --- An API is an application programming interface (API) that serves as an interface between a web server and a web browser. A web API allows for the sharing of data and functionality between web apps. For example, [SendGrid’s Web API]({{root_url}}/api-reference/) enables users to retrieve data about their email program like spam reports or blocked email addresses. Using a web API is extremely efficient because it eliminates the need for code-sharing – a process that can be complex and messy while making some developers uncomfortable. Web APIs allow you to easily share a certain set of features and data with a large group of people while maintaining privacy and to create consistency in the delivery of that data and functionality while saving valuable development time and money. Channel the notoriously private Google and you’ll quickly understand why using web APIs has become the preferred method in the development community. Consumers are looking for super easy ways to sync the plethora of services they employ in their everyday lives, whether it be for personal or business use. Using a Facebook or Google+ ID to log in to a third-party app is a super simple example of how a web API can create efficiency for both user and developer. However, apps that power their services using third party web APIs are limited to the features made available from the originating application and/or its longevity in the marketplace. What is available today may not be available tomorrow so having a contingency plan should be a developer’s priority. SendGrid’s web API is specific to email delivery using our platform. Integration using our web API allows you to collect account and email data including response rates, spam reports, and statistics. This option serves an alternative to our [SMTP configuration]({{root_url}}/for-developers/sending-email/getting-started-smtp/) in that it supports situations when HTTP is your only option, or in situations where you do not control your application environment. Additionally, if there is high latency between our 2 apps or if you’ve built a library to send email, our web API makes integration with SendGrid super easy. SendGrid’s web API allows our customers to pull information about their email program without having to actually log on to SendGrid.com. Customers can pull lists, statistics, and even email reports. In addition to this, Customers can send email via the web API without using [traditional SMTP]({{root_url}}/glossary/smtp/). We also provide an [SMTP API]({{root_url}}/glossary/smtp-api/) that functions a bit differently than our web API. Our SMTP API allows customers to use message templates, provide custom delivery and handling options, and include advanced tracking and analytics. [SendGrid is a mail server]({{root_url}}/glossary/smtp-server/) built for developers by developers. We provide the most comprehensive solutions for simplified email delivery. With over 150,000 companies using SendGrid, we have become the largest email infrastructure as a service provider in the world. ================================================ FILE: content/docs/glossary/whitelabel.md ================================================ --- seo: title: Whitelabel title: Whitelabel weight: 0 layout: page navigation: show: false --- In an attempt to clarify complex functionality, SendGrid is upgrading the name of Whitelabel. **A whitelabel is now generally called sender authentication.** A domain whitelabel is now called [domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). A link whitelabel is now called [link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/). An IP Whitelabel is now called [reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/). Sender authentication refers to the process of showing ISPs that SendGrid has your permission to send emails on your behalf. To set up a sender authentication, add DNS records to your hosting service. These DNS records associate your sending domain with SendGrid— when an inbox provider processes your email, they will see your domain instead of sendgrid.net. You can also add authentications for the links in your email as well as dedicated IP addresses associated with your account (available with Pro level or higher accounts). ## Additional Resources - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ================================================ FILE: content/docs/glossary/x-message-id.md ================================================ --- seo: title: X-Message-ID description: The X-Message-ID is a header returned when making a mail send. keywords: X-Message-ID, Track title: X-Message-ID weight: 0 layout: page navigation: show: false --- The following image depicts a response after the mail is sent: ![]({{root_url}}/images/example_response.png "Example Response") The X-Message-ID is a header returned when making a mail send which can be used to track events that the Event Webhook posts. When using the Event Webhook, it's a best practice to store your X-Message-ID. X-Message-ID data helps with deduplications in your webhook data. It can be used to find all corresponding Message-IDs. SendGrid recommends that users store this data to correlate to their Event Webhook data, and this data is very useful for Support troubleshooting. Related Articles - [Message-ID]({{root_url}}/glossary/message-id) ================================================ FILE: content/docs/release-notes/2017-07-07.md ================================================ --- title: "release notes 2017-07-07" date: 2017-07-07 releaseType: - ui --- ### Responsive image enhancements Images are now responsive to the container they’re held within, as opposed to being a percent of their original size. ================================================ FILE: content/docs/release-notes/2017-08-01.md ================================================ --- title: "release notes 2017-08-01" date: 2017-08-01 releaseType: - ui --- ### New editing experience The editing experience has been updated to offer <a href="https://sendgrid.com/blog/taking-the-pain-out-of-email-design-and-editing/">a better user experience</a> when creating email campaigns or templates. Whether using marketing or transactional templates, you can choose between a marketer-friendly code editor and a flexible design editor that still offers HTML options. ================================================ FILE: content/docs/release-notes/2017-09-05.md ================================================ --- title: "release notes 2017-09-05" date: 2017-09-05 releaseType: - partners --- ### Amazon Marketplace SendGrid is now available on the <a href="https://aws.amazon.com/marketplace/pp/B074CQY6KB">AWS Marketplace</a>! AWS customers are now able to integrate SendGrids email infrastructure and email marketing tools with their other AWS tools. For more information, see the <a href="https://aws.amazon.com/blogs/apn/inside-sendgrids-expanded-relationship-with-aws/">blog</a> and the [documentation](/for-developers/partners/amazon-marketplace/). ================================================ FILE: content/docs/release-notes/2017-09-14.md ================================================ --- title: "release notes 2017-09-14" date: 2017-09-14 releaseType: - ui --- ### Save your favorite colors You now can save swatches of commonly used colors when designing email templates or campaigns. ================================================ FILE: content/docs/release-notes/2017-10-02.md ================================================ --- title: "release notes 2017-10-02" date: 2017-10-02 releaseType: - api - ui --- ### Substitution tag update Substitution tags are no longer case sensitive in the email content. Previously, the substitution tag in your email content had to exactly match the substitution tag. For example, if you have the substitution tag <code>[%panda%]</code>, and your email content says <code>"hello [%PANda%], buy my bamboo"</code>, the substitution tag for <code>[%panda%]</code> is now applied. ================================================ FILE: content/docs/release-notes/2017-10-11.md ================================================ --- title: "release notes 2017-10-11" date: 2017-10-11 releaseType: - api --- ### Custom field update The limit of custom fields you can create has been increased to 120. This limit can be applied to any type of data contained in a contacts list including numbers, text, or dates. ================================================ FILE: content/docs/release-notes/2017-11-01.md ================================================ --- title: "release notes 2017-11-01" date: 2017-11-01 releaseType: - ui --- ### Marketing Campaigns Contacts The Contacts page in Marketing Campaigns has been updated to improve the user experience! The UI has been simplified to make adding contacts more streamlined and easy-to-use. For more information, see [adding contacts](/ui/managing-contacts/create-and-manage-contacts/). ================================================ FILE: content/docs/release-notes/2017-12-20.md ================================================ --- title: "release notes 2017-12-20" date: 2017-12-20 releaseType: - ui --- ### Mailbox Provider Statistics The mailbox provider statistics page has been updated to show more intuitive delivery percentages by each mailbox provider -for example clicks of delivered (by day by provider), instead of clicks of all clicks (by day by all providers). ================================================ FILE: content/docs/release-notes/2018-01-04.md ================================================ --- title: "release notes 2018-01-04" date: 2018-01-04 releaseType: - ui - api --- ### Table & Column Rendering in Outlook We've resolved a bug affecting the way that tables/columns were rendering in some versions of Outlook. ================================================ FILE: content/docs/release-notes/2018-02-13.md ================================================ --- title: "release notes 2018-02-13" date: 2018-02-13 releaseType: - ui --- #### Transactional Templates Search & Filtering We've updated the Transactional Templates index page, allowing for dynamic search and filtering functionality by name, template ID, and template version ID. In addition to this improvement, we've updated what is seen when no templates are present –– more clearly conveying the need for a template version and offering a button to create one. ================================================ FILE: content/docs/release-notes/2018-02-16.md ================================================ --- title: "release notes 2018-04-13" date: 2018-04-13 releaseType: - ui --- ### CSV Upload Notification Email Address We've made it easier for you to receive CSV upload notifications by adding an additional link to the CSV processing step. This link allows you to add an email address to your notifications directly from the contacts page and save it for future use. ================================================ FILE: content/docs/release-notes/2018-02-27.md ================================================ --- title: "release notes 2018-10-01" date: 2018-02-27 releaseType: - ui --- ### Dates & Times Displayed on Campaigns Index The Campaigns index page in Marketing Campaigns has been updated so that dates and times for important campaign events (like last edited or sent) are shown natively, below the name of each campaign. ================================================ FILE: content/docs/release-notes/2018-03-01.md ================================================ --- title: "2018-03-01" date: 2018-03-01 releaseType: - ui - api --- ### Email Activity Feed - Beta As of 01 March 2018, we are beginning to roll out early beta access to our new Email Activity feature. This release includes enhancements to email activity feed details, filtering, search options, and CSV export capability to ease the process of troubleshooting email delivery issues. ================================================ FILE: content/docs/release-notes/2018-03-06.md ================================================ --- title: "release notes 2018-03-06" date: 2018-03-06 releaseType: - ui --- ### Code Editor Color Scheme The color scheme (theme) of the code editor within Marketing Campaigns has been updated to be more visually clean and consistent. The new look helps code appear less cluttered, while aligning more closely with the SendGrid brand. ================================================ FILE: content/docs/release-notes/2018-03-08.md ================================================ --- title: "release notes 2018-03-08" date: 2018-03-08 releaseType: - api - ui --- ### Unsubscribe Tag Support for Transactional Templates The Unsubscribe module now uses asm tags in order to work with both Marketing Campaigns and Transactional email. To add unsubscribe links to your template, use the `<%asm_group_unsubscribe_raw_url%>`, `<%asm_global_unsubscribe_raw_url%>`, or `<%asm_preferences_raw_url%>` tags. ================================================ FILE: content/docs/release-notes/2018-03-14.md ================================================ --- title: "release notes 2018-03-14" date: 2018-03-14 releaseType: - ui --- ### Fixed a segmentation date issue There was a bug in the UI that affected the way that dates displayed for events when creating a segment. Specifically, the UI would show "01/01/70" as dates for events, when there was no data present. This has been resolved and now aligns with the rest of the UI, displaying "-" when applicable. ================================================ FILE: content/docs/release-notes/2018-03-16.md ================================================ --- title: "release notes 2018-10-01" date: 2018-03-16 releaseType: - ui --- ### New Design Templates for Marketing Campaigns We've added two new templates to the SendGrid Marketing template library! These templates, named "Modern" and "Coffee", offer fully-responsive and clean designs, giving you the framework you need to build beautifully engaging marketing campaigns. The new templates can be accessed by clicking **Templates** in the navigation, and selecting the **Marketing** option. ================================================ FILE: content/docs/release-notes/2018-03-29.md ================================================ --- title: "release notes 2018-03-29" date: 2018-03-29 releaseType: - ui - api --- ### Email Activity Feed The Email Activity Feed has been updated to include enhancements to email activity feed details, filtering, search options, and CSV export capability to ease the process of troubleshooting email delivery issues. In addition to the new enhancements, customers have the option to purchase 30 days of additional email activity history which includes API endpoint access. ================================================ FILE: content/docs/release-notes/2018-04-09.md ================================================ --- title: "release notes 2018-04-09" date: 2018-04-09 releaseType: - ui - api --- ### Truncating fields that go over max field character limits This change applies to contacts added by uploading a CSV in the UI or when using the <code>POST /contactdb/lists/{list_id}/recipients/{recipient_id}</code> Add a Single Recipient to a List method. When adding or updating the <code>first_name</code> and <code>last_name</code> fields, SendGrid automatically truncates any field that exceeds the maximum character limit to ensure that the field is valid. Non-unicode characters are still not valid. ================================================ FILE: content/docs/release-notes/2018-04-10.md ================================================ --- title: "release notes 2018-04-10" date: 2018-04-10 releaseType: - ui --- ### Updated Alert Behavior In order to provide a better user experience, we've updated the green alert banners you see at the top of the app. Green banners that notify users of successful actions now automatically dismiss after a few seconds, no longer stacking up within the field of view. ================================================ FILE: content/docs/release-notes/2018-04-11.md ================================================ --- title: "release notes 2018-04-11" date: 2018-04-11 releaseType: - partners --- ### Magento M1 and M2 Extension Update We have upgraded our Magento Extension for M1 and M2 Marketplaces to V1.0.3. SendGrid’s extension in M1 and M2 is compatible with Magento Community 2.0, 2.1, 2.2. ================================================ FILE: content/docs/release-notes/2018-04-17.md ================================================ --- title: "release notes 2018-04-17" date: 2018-04-17 releaseType: - ui --- ### Whitelabel is becoming Sender Authentication! To clarify authentication at SendGrid, we are updating the names of Whitelabel! A whitelabel is now generally called sender authentication. A domain whitelabel is now called domain authentication. A link whitelabel is now called link branding. An IP Whitelabel is now called reverse DNS. ### Improved Sender Authentication Process SendGrid’s whitelabel has become sender authentication, which simplifies the process for senders to demonstrate domain ownership through multiple authentication methods to recipient mailbox providers in order to improve their email delivery. This launch includes improvements to the set up flow and a more accurate name for the functionality. All pending and verified whitelabels can be found under sender authentication. For more information on the new process for sender authentication: - Access [Sender Authentication](https://app.sendgrid.com/settings/sender_auth) - Read the [blog post](https://sendgrid.com/blog/new-sender-authentication/) about Sender Authentication. - Check out our how to docs on [How to set up domain authentication]({{root_url}}/ui/sending-email/how-to-set-up-domain-authentication/) and [How to set up link branding]({{root_url}}/ui/sending-email/how-to-set-up-link-branding/) ================================================ FILE: content/docs/release-notes/2018-05-01.md ================================================ --- title: "release notes 2018-05-01" date: 2018-05-01 releaseType: - price --- ### Sales tax for customers in certain US jurisdictions We’re beginning to charge sales tax for use of certain SendGrid products by non-tax exempt customers based in WA, NY, TX, Denver, Boulder or Chicago. This change is required to comply with applicable tax laws. For more information about our new sales tax and how to delcare your organization tax exempt, see [Sales Taxes and Tax-Exempt Status](/ui/account-and-settings/taxes-and-tax-exempt/). ================================================ FILE: content/docs/release-notes/2018-05-15.md ================================================ --- title: "release notes 2018-05-15" date: 2018-05-15 releaseType: - ui --- ### Send To and Export All Contacts We've updated Marketing Campaigns to allow you to send to and export all contacts within your database. Your 'All Contacts' database now operates like other lists that you create. To send to all contacts, select "All Contacts" from the recipients dropdown when editing a campaign. To export all contacts, select "Export" from the action menu on the <a href="https://sendgrid.com/marketing_campaigns/ui/contacts" target="_blank">Contacts page</a> or by clicking the "Export CSV" button, now located in the top-right when viewing <a href="https://sendgrid.com/marketing_campaigns/ui/all_contacts" target="_blank">All Contacts</a>. ================================================ FILE: content/docs/release-notes/2018-06-06.md ================================================ --- title: "release notes 2018-06-06" date: 2018-06-06 releaseType: - api --- ### TLS security SendGrid now uses Transport Layer Security (TLS) protocol v1.1 to send encrypted mail. If you have the Enforce TLS feature activated on one of your SendGrid accounts, messages sent to inbox providers that can only accept TLS v1.0 trigger a “TLS required but not supported” drop event. Based on our testing, most inbox providers support TLS versions v1.1 and above. ================================================ FILE: content/docs/release-notes/2018-07-23.md ================================================ --- title: "release notes 2018-10-01" date: 2018-07-23 releaseType: - ui - api --- ### Dynamic content for transactional templates We’ve added native support for a subset of Handlebars syntax in transactional templates sent using V3 of our Mail Send API. This new functionality allows you to iterate over lists, take advantage of conditionals, and use JSON test data to verify substitutions in the UI. For more information, check out our [Getting started with Handlebars documentation](/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/), and our in-depth look at the [Handlebars functionality](/ui/sending-email/using-handlebars/) that we support. ### Known issue in the V2 API `to` parameter If you use the API <code>to</code> parameter to specify a single recipient, that recipient is visible in the <code>For</code> field of the received header - so if you specify a single address, it should be an address that you are comfortable with your customer seeing. For example, use a generic email address in the <code>to</code> field that your customer is already going to see, like your from address. To completely omit the email showing up in the <code>from</code> header: - specify multiple addresses in the `to` field as an array, for example, `to[]=a@mail.com&to[]=b@mail.com` - Use the V3 mail send endpoint ================================================ FILE: content/docs/release-notes/2018-08-08.md ================================================ --- title: "release notes 2018-08-08" date: 2018-08-08 releaseType: - ui --- ### Unsubscribe Group Workflow We’ve made managing your Unsubscribe Groups more intuitive and beautiful than ever. Create and edit Unsubscribe Groups with confidence, knowing exactly what your recipients will see, thanks to a side-by-side preview of both your Unsubscribe Preferences and confirmation pages. To learn more, take a look at our [documentation]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/). ================================================ FILE: content/docs/release-notes/2018-08-22.md ================================================ --- title: "release notes 2018-08-22" date: 2018-08-22 releaseType: - ui - api --- ### SendGrid Documentation is now the SendGrid Knowledge Center The SendGrid Knowledge Center empowers you to get the most from your account with concise how-to resources and reference information on the SendGrid user interface, Marketing Campaigns, APIs, and webhooks. The Knowledge Center replaces Documentation with a new look, easy-to-navigate layout, and streamlined access to technical information with the “For Developers” section. ================================================ FILE: content/docs/release-notes/2018-09-26.md ================================================ --- title: "release notes 2018-09-26" date: 2018-09-26 releaseType: - ui --- ### Introducing SendGrid Academy We’re excited to introduce the SendGrid Academy––a free online learning community, enabling you to take email education into your own hands. Whether you’re a seasoned email expert or preparing to send your very first campaign, SendGrid Academy will allow you to choose your own path through streamlined, guided courses that can be completed in 10-15 minutes. ================================================ FILE: content/docs/release-notes/2018-10-15.md ================================================ --- title: "release notes 2018-10-15" date: 2018-10-15 releaseType: - ui --- ### Email Insights Reports With SendGrid Email Insights Reports, a deliverability consultant will take an in-depth look at the performance and health of your email program every other week. Then they’ll put together a report containing actionable and customized recommendations on how you can improve your results and drive more business from email. Please <a href="https://go.sendgrid.com/Email-Insights-Reports.html">contact our team</a> to learn more. ### Email Protection Plan SendGrid’s new Email Protection Plan gives you peace of mind that if something goes wrong with your email program you’ll have quick access to experts to diagnose the issue and create a customized repair plan to get you back up and running. For a monthly subscription, you’ll receive coverage for up to 4 email deliverability issues per year plus monthly reporting for ongoing monitoring. Please <a href="https://go.sendgrid.com/Insights-Reports-Protection-Plan.html">contact our team</a> to learn more. ================================================ FILE: content/docs/release-notes/2018-11-05.md ================================================ --- title: "release notes 2018-11-05" date: 2018-11-05 releaseType: - ui --- ## Reverse DNS Improvements - Beta You can now access the open beta for the improved Reverse DNS process within sender authentication. This beta simplifies the process for senders to set up Reverse DNS - which demonstrates domain and IP address ownership to recipient mailbox providers to improve their email delivery. Find all pending and verified Reverse DNS records under Reverse DNS within Sender Authentication, and you can switch back from the beta experience at any time. To learn more about this beta, check out our [how-to docs](https://sendgrid.com/docs/ui/account-and-settings/reverse-dns/) or opt-in in the [SendGrid UI](https://app.sendgrid.com/settings/sender_auth/reverse_dns/beta). ================================================ FILE: content/docs/release-notes/2018-11-09.md ================================================ --- title: "release notes 2018-11-09" date: 2018-11-09 releaseType: - ui --- ## Change to Allowed “From” Domains - API In order to continue to protect your reputation, we no longer process messages with a "from" domain that includes sendgrid.net. Customers should update the “from” address for all of your emails to include a domain you own and control. As a trusted sender, SendGrid promotes and supports ownership of all reputation factors for email sending. One major factor to senders’ reputations is the domains used, and it’s imperative that all senders optimize their own sending to control this reputation factor. ================================================ FILE: content/docs/release-notes/2018-11-14.md ================================================ --- title: "release notes 2018-11-14" date: 2018-11-14 releaseType: - ui --- ## Invalid Events Retained for 30 Days In order to optimize the efficiency of our infrastructure, we will cap our retention of all invalid drop events to the last 30 days. [An invalid event](https://sendgrid.com/docs/ui/sending-email/index-suppressions/#different-types-of-suppressions) occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server. It is best practice remove invalid email addresses from your database after receiving the [webhook event](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook/) for invalid, pulling from the [invalid API](https://sendgrid.api-docs.io/v3.0/invalid-emails-api/retrieve-all-invalid-emails), or downloading a list of invalids from the [SendGrid UI](https://sendgrid.com/docs/ui/sending-email/invalid-emails/) every week, and removing them from your mailing lists. ================================================ FILE: content/docs/release-notes/2018-12-01.md ================================================ --- title: "release notes 2018-12-01" date: 2018-12-01 releaseType: - ui --- ## Essentials and Bronze Price Change Effective December 1st, 2018 our Essentials and Bronze plan prices have changed. Essentials 40K/Bronze is $14.95 and Essentials 100K is $29.95. This price increase will ensure we continue to provide customers a best-in-class experience as well as support ongoing innovation. Please note, this pricing is already in effect for new customers, but existing essentials customers’ January bill will reflect these changes. The features included in the [Essentials](https://sendgrid.com/pricing/) plan and prices of add-ons are not changing. You can review past invoices and update your [Plan and Billing Details](https://app.sendgrid.com/settings/billing) in the SendGrid application. If you have any questions please reach out to our knowledgeable [support team](https://support.sendgrid.com/hc/en-us). ================================================ FILE: content/docs/release-notes/2018-12-17.md ================================================ --- title: "release notes 2018-12-17" date: 2018-12-17 releaseType: - ui --- ## Plan & Billing Details Page Improvements Your [Plan & Billing Details page](https://app.sendgrid.com/account/billing) has been updated to add clarity and ease the ability to view and change SendGrid plans and billing details. These improvements simplify self-service plan changes, add-on purchase selection, payment acceptance, and understanding of Marketing Campaigns contact storage charges. As a part of the Account Details for your SendGrid account, the Plan and Billing Details page is only accessible in [Account Details](https://app.sendgrid.com/settings/account) under Settings starting January 7th, 2019. Check out our documentation for more information on the new [Plan & Billing Details page](https://app.sendgrid.com/account/billing). ================================================ FILE: content/docs/release-notes/2019-01-17.md ================================================ --- title: "release notes 2019-01-17" date: 2019-01-17 releaseType: - ui --- ## Reverse DNS Improvements The improved Reverse DNS process within sender authentication simplifies the process for senders to setup Reverse DNS to demonstrate domain and IP ownership to recipient mailbox providers in order to improve their email delivery. All pending and verified Reverse DNS records can still be found under Reverse DNS within Sender Authentication. To learn more check out our how to docs or try it out in the SendGrid UI. ================================================ FILE: content/docs/release-notes/2019-02-25.md ================================================ --- title: "release notes 2019-02-25" date: 2019-02-25 releaseType: - api --- ### Event Webhook Unique ID Specification Change We have updated the length and format specification of the `sg_event_id`, part of the JSON object included with each webhook post. Now, the `sg_event_id` will be limited to 100 characters, will be URL safe, and no longer has a specified format. You can use the `sg_event_id` to deduplicate events received by the webhook. ================================================ FILE: content/docs/release-notes/2019-04-01.md ================================================ --- title: "release notes 2019-04-01" date: 2019-04-01 releaseType: - api - ui --- ### Change to Allowed “From” Domains - SMTP In order to continue to protect your reputation, we no longer process messages with a "from" domain that includes sendgrid.net. Customers should update the “from” address for all of your emails to include a domain you own and control. As a trusted sender, SendGrid promotes and supports ownership of all reputation factors for email sending. One major factor to senders’ reputations is the domains used, and it’s imperative that all senders optimize their own sending to control this reputation factor. ================================================ FILE: content/docs/release-notes/2019-04-02.md ================================================ --- title: "release notes 2019-04-02" date: 2019-04-02 releaseType: - expert-services --- ### Expert Services Available Via the SendGrid UI for Purchase Expert Services allows senders to partner with our internal email experts to receive guidance on smoothly implementing SendGrid for their business, repairing deliverability issues, and optimizing their sending strategy. Now some of our Expert Services packages are available for you to purchase directly through your [Billing page](https://app.sendgrid.com/account/billing). Learn more about our Expert Services offerings [here](https://sendgrid.com/solutions/expert-services/). ### Email Bootcamp Now Available Become a power user of the SendGrid platform with SendGrid's new Email Bootcamp. In a guided 2-hour educational webinar, our experts will walk you and other email senders like you through how to set up and use SendGrid's products so that you can start sending efficiently and effectively. If you have an existing SendGrid account, you can [buy this service now](https://app.sendgrid.com/account/billing/expert_services/implementation) through our UI. ### Expert Insights Advanced Deliverability Report Improvements Expert Insights is an advanced monthly report on your email health and performance. We’ve added more data that’s critical for understanding your sender reputation including spam traps, deny lists, IP health, and more. We’ve also introduced a new robust resource exclusive for Expert Insights customers with expert step-by-step instructions to repair issues and improve results. If you are a Pro customer with an existing SendGrid account, you can [buy this service now](https://app.sendgrid.com/account/billing/expert_services/implementation) through our UI; otherwise, please [contact our team](https://sendgrid.com/expert-services-questions/) to purchase Expert Insights. View a sample report [here](https://sendgrid.com/solutions/expert-insights/). ### Expert Analysis Now Available With Expert Analysis, you’ll understand the health of your email program and what actions you need to take to improve. After an email expert compiles an advanced report on your email deliverability and performance, you’ll receive a consultation in which we’ll review your results, provide an action plan for your areas of improvement, and answer your questions. Please [contact our team](https://sendgrid.com/expert-services-questions/) to learn more about this service. ================================================ FILE: content/docs/release-notes/2019-04-03.md ================================================ --- title: "release notes 2019-04-03" date: 2019-04-03 releaseType: - api - ui --- ## Transactional Template Plain Content We’ve added an optional `generate_plain_content` field on Create (POST) and Update (PATCH) calls for Template versions. Setting this field to `true` will automatically generate plain text content, based on the HTML content. If false, any plain text content passed to SendGrid on the request will remain unchanged. ================================================ FILE: content/docs/release-notes/2019-04-17.md ================================================ --- title: "release notes 2019-04-17" date: 2019-04-17 releaseType: - ui - api --- ### Basic Authentication with Two-Factor Authentication Previously, customers with two-factor authentication enabled could utilize basic authentication over the SendGrid v2 API, v3 API (excluding v3 mail send), or SMTP. We have identified this as a misalignment between customers’ expectations of security with 2FA and the [authentication options]({{root_url}}/for-developers/sending-email/authentication/) permitted on their SendGrid accounts. In an abundance of caution, we have begun rejecting API calls using basic authentication if the user or subuser has two-factor authentication enabled. We recommend [implementing API keys]({{root_url}}/ui/account-and-settings/api-keys/) for your SendGrid API calls. If API key authentication is not possible, [disable two-factor authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/#disabling-two-factor-authentication/) from accounts which continue to use basic authentication and enable [IP access management]({{root_url}}/ui/account-and-settings/ip-access-management/) to improve security. ================================================ FILE: content/docs/release-notes/2019-04-22.md ================================================ --- title: "release notes 2019-04-22" date: 2019-04-22 releaseType: - ui - api --- ### Support for Google AMP for Email SendGrid’s v3 mail/send API now supports ordering MIME parts as [recommended by Google for sending AMP](https://amp.dev/documentation/guides-and-tutorials/learn/amp-email-format#the-amphtml-email-format) content in Email messages for maximum compatibility with recipients’ mail clients. Senders using SendGrid’s v3 mail/send API can now include the text/x-amp-html content type alongside text/plain and text/html ordered as “text / amp / html” to accommodate rendering across recipient email clients. We do not process the AMP part of the content for click and open tracking at this time. SendGrid’s v2 Mail API does not support definition of the custom MIME x-amp-html part required for AMP content, therefore we recommend customers [migrate to the v3 API ]({{root_url}}/for-developers/sending-email/migrating-from-v2-to-v3-mail-send) to send AMP. For more information on Google AMP for Email see Google’s [documentation](https://amp.dev/documentation/guides-and-tutorials/learn/amp-email-format#the-amphtml-email-format). For information on how to use AMP content with SendGrid, please see our [Knowledge Center]({{root_url}}/for-developers/tracking-events/google-amp-for-email/). ================================================ FILE: content/docs/release-notes/2019-05-09.md ================================================ --- title: "release notes 2019-05-09" date: 2019-05-09 releaseType: - ui - api --- ### Tracking for Google AMP for Email SendGrid’s v3 mail/send API now supports click and open tracking for AMP content. Please note that [Google requires](https://amp.dev/documentation/guides-and-tutorials/learn/amp-email-format#the-amphtml-email-format) all images to use HTTPS, which will require customers who wish to track opens to do additional setup with their [SSL certificates]({{root_url}}/ui/analytics-and-reporting/click-tracking-ssl/) to ensure that their recipients opens are tracked. We recommend sending AMP over SendGrid’s v3 API, v2 mail/send does not support the custom MIME parts required for AMP, and you are responsible for the structure of the email when sending via SMTP. For more information on Google AMP for Email see Google’s [documentation](https://amp.dev/documentation/guides-and-tutorials/learn/amp-email-format#the-amphtml-email-format). For information on how to use tracking for AMP content with SendGrid, please see our [Knowledge Center]({{root_url}}/for-developers/tracking-events/google-amp-for-email/). ================================================ FILE: content/docs/release-notes/2019-06-04.md ================================================ --- title: "release notes 2019-06-04" date: 2019-06-04 releaseType: - api --- ### Removal of Legacy Email Activity API - Free Plans In order to continue to optimize the efficiency of our infrastructure we are removing access to the undocumented legacy email activity API for Free plans. We recommend using the [event webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) to absorb your email event data or visit the [enhanced email activity feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) in the UI to pinpoint specific email messages with its sequential event data. If you are interested in the ability to search and download a CSV with 30 days of email event activity programmatically, you could consider upgrading to an essentials account and purchasing additional history with access to the [new email activity API](https://sendgrid.api-docs.io/v3.0/email-activity/filter-all-messages). ================================================ FILE: content/docs/release-notes/2019-07-02.md ================================================ --- title: "release notes 2019-07-02" date: 2019-07-02 releaseType: - ui - api --- ### New Marketing Campaigns - Early Access A brand new version of Marketing Campaigns is now in Early Access, with the addition of [Automation](https://sendgrid.com/solutions/marketing-automation/), [Email Testing](https://sendgrid.com/solutions/email-marketing-testing/?ts=1559925149), and [Signup Forms](https://sendgrid.com/solutions/signup-forms/). These new features are incremental to the existing functionality for [one-to-many campaign sending]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/#creating-a-single-send), [contact management]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#manage-contacts), [real-time analytics]({{root_url}}/ui/analytics-and-reporting/stats-overview/), and more. ================================================ FILE: content/docs/release-notes/2019-07-10.md ================================================ --- title: "release notes 2019-07-10" date: 2019-07-10 releaseType: - ui - api --- ### New Marketing Campaigns A brand new version of Marketing Campaigns, with the addition of [Automation]({{root_url}}/ui/sending-email/getting-started-with-automation/), [Email Testing]({{root_url}}/ui/sending-email/email-testing/), and [Signup Forms]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#create-a-signup-form) is now generally available. These new features are incremental to the existing functionality for [one-to-many campaign sending]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/#creating-a-single-send), [contact management]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#manage-contacts), real-time analytics, and more. ================================================ FILE: content/docs/release-notes/2019-07-16.md ================================================ --- title: "release notes 2019-07-16" date: 2019-07-16 releaseType: - api --- ### Removal of Legacy Email Activity API - Essential Plans In order to continue to optimize the efficiency of our infrastructure, we are removing access to the undocumented legacy email activity API for Essential plans. We recommend using the [event webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) to absorb your email event data or visit the [enhanced email activity feed]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) in the UI to pinpoint specific email messages with its sequential event data. If you are interested in the ability to search and download a CSV with 30 days of email event activity programmatically, you should consider purchasing additional history with access to the [new email activity API](https://sendgrid.api-docs.io/v3.0/email-activity/filter-all-messages). ================================================ FILE: content/docs/release-notes/2019-07-31.md ================================================ --- title: "release notes 2019-07-31" date: 2019-07-31 releaseType: - ui --- ### Create and send a Single Send to a custom field based segment The new version of Marketing Campaigns now supports sending a Single Send to a segment based on contact custom field data for more personalized sending. ================================================ FILE: content/docs/release-notes/2019-08-06.md ================================================ --- title: "release notes 2019-08-06" date: 2019-08-06 releaseType: - api --- ### Email Validation API in Open Beta Our real-time [Email Validation API](https://sendgrid-email-validation.api-docs.io/v3/getting-started/authentication) helps protect your sending reputation by validating email addresses before you send to them. Use detailed results from our machine learning-powered, mailbox provider-friendly API to alert subscribers of possible typos while they’re still in the signup form and protect your sending reputation by decreasing the risk of your email bouncing. Currently available for free while in Beta to Pro and Premier Email API plans. Learn more about [this announcement](https://sendgrid.com/blog/sendgrid-email-validation-api/), [how to use it](https://sendgrid.com/docs/ui/managing-contacts/email-address-validation/), and the [future pricing](http://sendgrid.com/solutions/email-validation-api/). ================================================ FILE: content/docs/release-notes/2019-08-26.md ================================================ --- title: "release notes 2019-08-26" date: 2019-08-26 releaseType: - api --- ### Valid Characters for Event Webhook Authentication We have updated the characters that can be included in the credentials for webhook authentication. Starting today, characters will be limited to those that are included on [this list]({{root_url}}/for-developers/tracking-events/event/#authentication). Please ensure your webhook credentials (username + password) adhere to this updated list to continue uninterrupted access to our webhook. ================================================ FILE: content/docs/release-notes/2019-08-27.md ================================================ --- title: "release notes 2019-08-27" date: 2019-08-27 releaseType: - ui - api --- ### Scale SLA increases The new version of Marketing Campaigns now supports contact storage for up to 10M contacts per user, with additional scale possible on a per-user request. ### Default syntax for substitution tags The new version of Marketing Campaigns uses a new syntax for the default or fallback value of a substitution tag used in a Marketing Campaigns email subject line or body content. The default syntax is `{{ insert first_name "default=Customer" }}`. ================================================ FILE: content/docs/release-notes/2019-09-04.md ================================================ --- title: "release notes 2019-09-04" date: 2019-09-04 releaseType: - ui - ui --- ### Duplicate existing email designs (templates) in Marketing Campaigns The new version of Marketing Campaigns now supports the ability to duplicate and revamp an existing email design. From the design library, select “Duplicate” from the action menu. ### A/B Testing for Single Sends The new version of Marketing Campaigns now supports A/B testing for Single Sends, allowing up to 6 variations of either subject line or content. The winner is chosen automatically based on either open rate or click rate performance (depending on the user’s selection). ================================================ FILE: content/docs/release-notes/2019-09-05.md ================================================ --- title: "release notes 2019-09-05" date: 2019-09-05 releaseType: - ui --- ### View a sample of contacts on a segment The new version of Marketing Campaigns now provides a sample of 50 contacts within the UI for any given segment. To view all contacts included in a segment at any given time, users can use the export option. ================================================ FILE: content/docs/release-notes/2019-09-10.md ================================================ --- title: "release notes 2019-09-10" date: 2019-09-10 releaseType: - ui - api --- ### Create and send a Single Send to an engagement-based segment The new version of Marketing Campaigns now supports sending a Single Send to a segment based on engagement data for more personalized sending. This includes whether they have or haven’t opened or clicked within a given timeframe as well as how they’ve engaged with a particular Single Send. ### Segmentation API with engagement functionality The new version of Marketing Campaigns now offers a Segmentation API to create and send to a segment that is based on engagement (opens/clicks) with any Single Send or a specific Single Send. ================================================ FILE: content/docs/release-notes/2019-09-19.md ================================================ --- title: 'release notes 2019-09-19' date: 2019-09-19 releaseType: - api - ui --- ### Domain Authentication Impact from Apple iOS 13 Apple iOS 13 includes “Sign in with Apple” Oauth feature which provides an optional private relay email for users and sender authentication requirements for Apple app developers. In order to send email to Apple Oauth private relay email addresses (@privaterelay.appleid.com), you will need to update your Domain Authentication settings within your SendGrid account. Failure to properly complete and register your SendGrid Domain Authentication with Apple will result in email sent to “privaterelay.appleid.com” returning a bounce event with the reason “550 5.1.1 bad mailbox name.” Visit the [Configuring Sign in with Apple documentation]({{root_url}}/ui/account-and-settings/configuring-sign-in-with-apple/) for step-by-step instructions. ================================================ FILE: content/docs/release-notes/2019-09-23.md ================================================ --- title: "release notes 2019-09-23" date: 2019-09-23 releaseType: - ui --- ### Send Test for Single Sends and Marketing Templates The new version of Marketing Campaigns now supports sending a test email to as many as ten email addresses. A test email can be sent for a Single Send, an email within an Automation, or an email design, and allows users to preview email content prior to sending or request review from partners outside of the UI. ================================================ FILE: content/docs/release-notes/2019-09-25.md ================================================ --- title: "release notes 2019-09-25" date: 2019-09-25 releaseType: - ui --- ### IP Pool Selection The new version of Marketing Campaigns now supports IP Pool Selection for [users who have created IP Pools]({{root_url}}/ui/account-and-settings/ip-pools). This allows senders to choose which IP Pool to send a Single Send or Automation from, providing improved control over reputation and deliverability. ================================================ FILE: content/docs/release-notes/2019-09-27.md ================================================ --- title: "release notes 2019-09-27" date: 2019-09-27 releaseType: - ui --- ### Templates becomes Design Library The new version of Marketing Campaigns now features a Design Library, a new, top-level navigation item in the navigation on the left that houses all Email Designs for use within Marketing Campaigns. “Templates” remains as an option under the Marketing [New] navigation, and, if clicked, it will bring customers to the Design Library. ================================================ FILE: content/docs/release-notes/2019-10-01.md ================================================ --- title: "release notes 2019-10-01" date: 2019-10-01 releaseType: - api --- ### Email Validation API Generally Available Our real-time [Email Validation](https://app.sendgrid.com/email_validation) API helps protect your sending reputation by validating email addresses before you send to them. Use detailed results from our machine learning-powered, mailbox provider-friendly API to alert website visitors of possible typos while they’re still in the signup form and protect your sending reputation by decreasing the risk of your email bouncing. Available to Pro and Premier Email API plans. Learn more about [this announcement](https://sendgrid.com/blog/email-validation-now-available), [how to use it](https://sendgrid.com/docs/ui/managing-contacts/email-address-validation/), and the [the pricing](http://sendgrid.com/solutions/email-validation-api/). ================================================ FILE: content/docs/release-notes/2019-10-09.md ================================================ --- title: "release notes 2019-10-09" date: 2019-10-09 releaseType: - ui --- ### View a sample of contacts on a list The new version of Marketing Campaigns now provides a sample of 50 contacts within the UI for any given list. To view all contacts included in a list, users can use the export option. ================================================ FILE: content/docs/release-notes/2019-10-10.md ================================================ --- title: "release notes 2019-10-10" date: 2019-10-10 releaseType: - api --- ### Imposing Rate Limits on some SendGrid V2 API Endpoints Twilio SendGrid now has a default rate limit of 600 requests/minute/user on some of the V2 API endpoints, excluding the mail/send endpoint. If you exceed that rate limit you will receive a 429 error response with a “too many requests” message. We recommend updating your processes to ensure you do not exceed our default rate limit of 600 requests/min/user. We also recommend building in the consumption of the rate limit headers we send back, which gives specific information about how many requests you have remaining and when the rate limit amount will reset. For more information, see the [Knowledge Center]({{root_url}}/for-developers/sending-email/using-the-v2-api/#rate-limits). ================================================ FILE: content/docs/release-notes/2019-10-23.md ================================================ --- title: 'release notes 2019-10-23' date: 2019-10-23 releaseType: - ui --- ### Domain Authentication for Sign in with Apple As part of Apple's [Sign in with Apple](https://developer.apple.com/sign-in-with-apple/) feature, users may signup for your app or website with a [private email relay](https://developer.apple.com/documentation/signinwithapplejs/communicating_using_the_private_email_relay_service) address generated by Apple. In order to deliver to these private relay addresses, you must verify your sending domain with Apple when implementing Sign in with Apple as an authentication provider. The SendGrid [domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) page now provides a settings option that will provide a properly configured address for use with your Apple Developer account. For more information please visit SendGrid's [Configuring Sign in with Apple page]({{root_url}}/ui/account-and-settings/configuring-sign-in-with-apple/). ================================================ FILE: content/docs/release-notes/2019-19-12.md ================================================ --- title: "release notes 2019-12-19" date: 2019-12-19 releaseType: - ui - api --- ### Email Content Testing for Dynamic Templates Test your email content against spam filters, validate hyperlinks, and preview HTML rendering across browsers and devices with Email Testing for Dynamic Templates. Monthly testing credits included for Trial, Pro and Premier plans, with additional credits available for purchase. See our Email Testing [documentation]({{root_url}}/ui/sending-email/email-testing/) for more details. We've made some improvements to Transactional Templates. We've renamed them to Dynamic Templates since they can be used to build the content for any type of email message sent over our Email API. They can be found in the app’s sidebar navigation under both the new “Email API” navigation item or the “Templates” navigation item. We've also eased ongoing template management by adding thumbnail images and allowing duplication of entire templates as well as the individual versions within a template. For more, see our [blog post about working with Dynamic Templates](https://sendgrid.com/blog/how-to-use-sendgrids-dynamic-templates-for-your-transactional-emails/). ### Designs API We’ve added a brand new Designs API, allowing you to easily create, edit, download, or delete Email Designs without relying on the SendGrid app UI. You can use the Designs you’ve created across all of your Twilio SendGrid Email—from Automations, to Single Sends, and Dynamic Templates. For more about working with the API, see our [API Reference](https://sendgrid.com/docs/api-reference/). ================================================ FILE: content/docs/release-notes/2020-01-01.md ================================================ --- title: 'release notes 2020-01-01' date: 2020-01-01 releaseType: - price --- ### Pro Plan Price and Feature Updates The Twilio SendGrid Pro, Silver, Gold, Platinum and Legacy Premier 2.5M plans have changed. These changes include a new price and new features. To see updated pricing visit our [pricing page](https://sendgrid.com/pricing/). Some plans also have new names. Silver, Gold, and Platinum plans are now Pro 100K, Pro 300K, and Pro 700K respectively. We’ve also extended [Email Activity](https://sendgrid.com/docs/ui/analytics-and-reporting/email-activity-feed/) history from 3 to 7 days included with all Pro plans, and launched [Email Testing for Dynamic Templates](https://sendgrid.com/blog/test-for-success-email-testing-for-your-programmatic-sending/). We are committed to continued investment in our infrastructure and innovation to provide the best-in-class features you need to build exceptional experiences with email. You can review past invoices and update your [Plan and Billing Details](https://app.sendgrid.com/settings/billing) in the SendGrid application. If you have any questions please reach out to our knowledgeable [support](https://support.sendgrid.com/hc/en-us) team. ================================================ FILE: content/docs/release-notes/2020-01-13.md ================================================ --- title: "release notes 2020-01-13" date: 2020-01-13 releaseType: - ui - api --- ### Retirement of Select Mail Settings As we continuously modernize our email delivery infrastructure, we have retired select, sparsely used, and outdated features in order to improve efficiency. The features we have retired include Plain Text to HTML, Gravatar, Spam Checker, Drop Feature, and the Sendwithus integration. For more details on these features and our recommended actions please see our [documentation]({{root_url}}/ui/account-and-settings/retired-mail-settings/). ================================================ FILE: content/docs/release-notes/2020-01-29.md ================================================ --- title: "release notes 2020-01-29" date: 2020-01-19 releaseType: - ui --- ### Dynamic Templates UI within "Email API" Navigation Dynamic Templates, formerly Transactional Templates, are used to design, build, test, store, and manage email content sent over the SendGrid Email API. Dynamic Templates can now be found under the Email API section within the SendGrid application navigation. The Templates navigation item has been removed. There are no changes to Dynamic Template functionality. For more information about setting up Dynamic Templates, visit [How to send an email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) in the docs. ================================================ FILE: content/docs/release-notes/2020-02-10.md ================================================ --- title: "release notes 2020-02-10" date: 2020-02-10 releaseType: - ui --- ### Segment-triggered Automations Automation (available within the Advanced Marketing Campaigns plan) now supports a new entry criteria option to trigger an automation when a contact joins a segment. This also expands the functionality of the exit criteria, automatically removing contacts when they no longer match the entry criteria (i.e., they’re no longer in the segment). For more information, see the documentation in the [Knowledge Center]({{root_url}}/ui/sending-email/getting-started-with-automation/) ================================================ FILE: content/docs/release-notes/2020-03-19.md ================================================ --- title: "release notes 2020-03-19" date: 2020-03-19 releaseType: - api --- ### Removal of originating IP from received email header As we strive to be the most trusted communication platform, we have removed the originating IP from the received email header to further protect our customers' privacy and security. This change should have no negative impact on deliverability, and no customer action is needed for sending email as a result of this change. ================================================ FILE: content/docs/release-notes/2020-04-07.md ================================================ --- title: "release notes 2020-04-07" date: 2020-04-07 releaseType: - ui --- ### Shortcut to create a segmented list In Marketing Campaigns, you can now segment contacts from a particular list directly from the Contacts page. This reduces the steps to create list-specific segments. ================================================ FILE: content/docs/release-notes/2020-04-13.md ================================================ --- title: "release notes 2020-04-13" date: 2020-04-13 releaseType: - ui --- ### Faster load time for stats Load times for Marketing Campaigns statistics are now faster after backend work to improve performance. ================================================ FILE: content/docs/release-notes/2020-04-21.md ================================================ --- title: "release notes 2020-04-21" date: 2020-04-21 releaseType: - ui --- ### Clearer test sends Marketing Campaigns supports sending a test email to up to 10 email addresses at a time. Now, when users send a test email, Marketing Campaigns automatically adds “Test -” to the beginning of the subject line. This ensures test recipients know the email is a test and was not yet actually sent to the targeted list or segment. ================================================ FILE: content/docs/release-notes/2020-04-30.md ================================================ --- title: "release notes 2020-04-30" date: 2020-04-30 releaseType: - ui --- ### Search and filter Single Sends Single Sends in Marketing Campaigns are now easier to find using new search and filter functionality. Users can search for a Single Send by name, or can filter to view all Single Sends by a particular status (draft, scheduled, or triggered) as well as by category. ================================================ FILE: content/docs/release-notes/2020-05-06.md ================================================ --- title: "release notes 2020-05-06" date: 2020-05-06 releaseType: - api --- ### Single Sends API update The Marketing Campaigns Single Sends API has been updated to simplify the steps to create, schedule, and send Single Sends via the API. Users no longer need to create a template first. To create and save a new Single Send, all that is required is a name. For complete details, please see our [overview page]({{root_url}}/for-developers/sending-email/single-sends-2020-update/) and the [API reference documentation](https://sendgrid.api-docs.io/v3.0/single-sends/create-single-send). ================================================ FILE: content/docs/release-notes/2020-05-18.md ================================================ --- title: "release notes 2020-05-18" date: 2020-05-18 releaseType: - api - ui --- ### Signed Event Webhook Requests and OAuth for Event Webhook in Public Beta Twilio SendGrid now provides two security features that allow you to verify that email event data is being posted by Twilio SendGrid: a Signed Event Webhook and OAuth 2.0. These security features are independent of one another and can be used together. Twilio SendGrid’s Signed Event Webhook uses the Elliptic Curve Digital Signature Algorithm to sign requests. The signature allows customers to verify that event data is being posted by Twilio SendGrid. OAuth 2.0 for the Twilio SendGrid Event Webhook allows customers to verify that Twilio SendGrid is properly authorized by them to post to their URLs using the Client Credentials grant type. To learn more about these new features in Beta, visit [our documentation]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook-security-features/). ### New image editing options The email editors within Marketing Campaigns now support more options for formatting your images. You can crop, flip and rotate your images, add filters, or make adjustments like contrast or opacity all from within your email editing workflow. These editing options are also available within the Design Library under Your Images. [Learn more]({{root_url}}/ui/sending-email/image-editor/). ================================================ FILE: content/docs/release-notes/2020-07-13.md ================================================ --- title: 'release notes 2020-07-13' date: 2020-07-13 releaseType: - api --- ### Signed Event Webhook Requests and OAuth for Event Webhook Generally Available Twilio SendGrid now provides two security features that allow you to verify that email event data is being posted by Twilio SendGrid: a Signed Event Webhook and OAuth 2.0. These security features are independent of one another and can be used together. Twilio SendGrid’s Signed Event Webhook uses the Elliptic Curve Digital Signature Algorithm to sign requests. The signature allows customers to verify that event data is being posted by Twilio SendGrid. OAuth 2.0 for the Twilio SendGrid Event Webhook allows customers to verify that Twilio SendGrid is properly authorized by them to post to their URLs using the Client Credentials grant type. To learn more about these new features, visit [our documentation]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook-security-features/). ================================================ FILE: content/docs/release-notes/2020-07-21.md ================================================ --- title: 'release notes 2020-07-21' date: 2020-07-21 releaseType: - ui --- ### Track clicks across all links within an email with Click Tracking See which links are getting the most clicks within your emails, and learn which link locations perform best. Learn more more about [click tracking]({{root_url}}/ui/analytics-and-reporting/marketing-campaigns-stats/#click-tracking) . ================================================ FILE: content/docs/release-notes/2020-08-13.md ================================================ --- title: 'release notes 2020-08-13' date: 2020-08-13 releaseType: - ui - api --- ### Export stats from Single Sends and Automations to CSV Download a CSV of your stats to view offline or share with teammates. [Learn about each available statistic]({{root_url}}/ui/analytics-and-reporting/marketing-campaigns-stats-overview/) in our documentation. ### Retirement of Sections and BCC mail settings As we continuously modernize our email delivery infrastructure, we have retired select, sparsely used, and outdated features in order to improve efficiency. The features we have retired include the Sections and BCC mail settings. For more details on these features and our recommended actions please see our [documentation]({{root_url}}/ui/account-and-settings/retired-mail-settings/). ================================================ FILE: content/docs/release-notes/2020-08-17.md ================================================ --- title: 'release notes 2020-08-17' date: 2020-08-17 releaseType: - ui --- ### Create segments based on “Date Added” and “Last Updated” of a Contact You can now create new segments based on two additional date criteria: when a contact was added to Marketing Campaigns and the last time a contact was updated. The criteria are listed as "Date Added" and "Last Updated" in Marketing Campaigns. For more information about segments, see [Segmenting your Contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/). ================================================ FILE: content/docs/release-notes/2020-08-19.md ================================================ --- title: 'release notes 2020-08-19' date: 2020-08-19 releaseType: - ui --- ### Duplicate a segment You can now create new segments by copying an existing segment and making minor modifications. The ability to duplicate a segment means you no longer have to start from scratch when creating new segments. For more information about creating segments, see [Segmenting your Contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/). ================================================ FILE: content/docs/release-notes/2020-09-03.md ================================================ --- title: 'release notes 2020-09-03' date: 2020-09-03 releaseType: - ui --- ### Segmentation based on Automation Events Twilio SendGrid now offers the ability to segment contacts based on their engagement with your automated emails. For more information, visit our [Segmentation documentation]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/#automations-fields). ================================================ FILE: content/docs/release-notes/2020-09-16.md ================================================ --- title: 'release notes 2020-09-16' date: 2020-09-16 releaseType: - api --- ### Specify multiple From addresses in personalizations Twilio SendGrid now allows you to define multiple From addresses in personalizations objects. This allows you to override the default sender in each personalization as long as the default sending domain and personalizations sending domains match. For more information, visit our [Personalizations documentation]({{root_url}}/for-developers/sending-email/personalizations/#sending-multiple-emails-from-multiple-senders-to-multiple-recipients). ================================================ FILE: content/docs/release-notes/2020-09-17.md ================================================ --- title: 'release notes 2020-09-17' date: 2020-09-17 releaseType: - ui - api --- ## Account Setup Requirements In order to enhance security for all of our users, we have added a few required steps before new users are able to upgrade to a paid Twilio SendGrid plan. These steps are required to verify your identity, secure access to your account, while also authenticating your reputation ownership; setting you up for future email delivery success. For more information on these requirements, visit [Verifying Your Account]({{root_url}}/ui/account-and-settings/verifying-your-account/) in the docs. ================================================ FILE: content/docs/release-notes/2020-09-29.md ================================================ --- title: 'release notes 2020-09-29' date: 2020-09-29 releaseType: - ui --- ## Test data available in the Design and Code Editors Both the Marketing Campaigns Design Editor and Code Editor now support test data. Test data allows you to render Substitution Tags using sample values directly in each Editor's preview window. By providing test data, you no longer need to send a test email to ensure that your dynamic data will be displayed properly. To get started with your own designs, see [Working with Marketing Campaigns Email Designs]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/). For more information on using test data in Marketing Campaigns, see our [Design and Code Editor documentation]({{root_url}}/ui/sending-email/editor/). ================================================ FILE: content/docs/release-notes/2020-11-11.md ================================================ --- title: 'release notes 2020-11-11' date: 2020-11-11 releaseType: - ui --- ### Segment Refresh Cadence Improvements Previously, segment samples did not refresh after initial segment creation (or after editing the conditions of a segment). With this release, segment samples are now refreshed hourly as long as Marketing Campaigns detects any changes as contacts enter or exit the segment. If no changes are detected, the next refresh will occur at 2 hours, and then 4, with a maximum delay to segment sample refresh of 24 hours. For a real-time view of all contacts within your segment at any time, you can always export a CSV. This is not dependent on the sample refresh cadence. For more information about the segment refresh cadence, see our [segmentation documentation](https://sendgrid.com/docs/ui/managing-contacts/segmenting-your-contacts/#segment-refresh-cadence). ### Preview Segment Sample Contacts From the Contacts page, you can now see when the next scheduled segment will occur by hovering over the segment contact count. This same information can also be found on the segment detail page beneath the total contact count for that segment. For a real-time view of all contacts within your segment at any time, you can always export a CSV. This is not dependent on the segment refresh cadence. The sample refresh cadence has also been made available to [Marketing Campaigns API](https://sendgrid.api-docs.io/v3.0/segmenting-contacts/create-segment) users via the `next_sample_update` field. ================================================ FILE: content/docs/release-notes/2020-11-18.md ================================================ --- title: 'release notes 2020-11-18' date: 2020-11-18 releaseType: - api --- ## API Key and 2FA Requirements Enforced for Free Users In order to enhance security for all of our users, Twilio SendGrid now requires customers on free plans to use API Key authentication on all API requests and SMTP configurations. Customers must also enable Two-Factor Authentication (2FA) for all users, subusers and teammates. Visit our docs for more information on [Upgrading to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/) and [Enabling Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). ================================================ FILE: content/docs/release-notes/2020-12-01.md ================================================ --- title: 'release notes 2020-12-01' date: 2020-12-01 releaseType: - ui --- ## New column layouts available for the Marketing Campaigns Design Editor The Marketing Campaigns Design Editor now supports four new column layouts. In addition to evenly proportioned columns, you can now create layouts with ratios of 1:2, 2:1, 1:3, and 3:1. As with prior layouts, each column contains multiple drop zones where you can add non-column modules such as buttons, text, and images. ================================================ FILE: content/docs/release-notes/2020-12-03.md ================================================ --- title: 'release notes 2020-12-03' date: 2020-12-03 releaseType: - ui --- ## New column layouts available for the Marketing Campaigns Design Editor The Marketing Campaigns Design Editor now supports four new column layouts. In addition to evenly proportioned columns, you can now create layouts with ratios of 1:2, 2:1, 1:3, and 3:1. As with prior layouts, each column contains multiple drop zones where you can add non-column modules such as buttons, text, and images. ================================================ FILE: content/docs/release-notes/2020-12-09.md ================================================ --- title: 'release notes 2020-12-09' date: 2020-12-09 releaseType: - api --- ## API Key and 2FA Requirements Enforced for Paid Users In order to enhance security for all of our users, Twilio SendGrid now requires customers on paid plans to use API Key authentication on all API requests and SMTP configurations. Customers must also enable Two-Factor Authentication (2FA) for all users, subusers, and teammates. Visit our documentation for more information on [Upgrading to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/) and [Enabling Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). ================================================ FILE: content/docs/release-notes/2020-12-10.md ================================================ --- title: 'release notes 2020-12-10' date: 2020-12-10 releaseType: - ui --- ## Signup Form Field Enhancement You can now add any [reserved field]({{root_url}}/ui/managing-contacts/custom-fields/#reserved-fields) or [custom fields]({{root_url}}/ui/managing-contacts/custom-fields/) to a signup form. This means marketers can capture more of the data that they rely on when contacts sign up via a signup form. The collected data will then flow directly into Contacts within Marketing Campaigns. ## Bulk Delete Automations You can now bulk delete Automations using the multi-select tool from the Automation homepage. To select one or more Automations to delete, click the checkbox to the left of the Automation. Next, open the **Selected** dropdown and then click **Delete**. ================================================ FILE: content/docs/release-notes/2020-12-16.md ================================================ --- title: 'release notes 2020-12-16' date: 2020-12-16 releaseType: - ui --- ## New Options Available for Rendering Previews You can now perform inbox rendering tests across new devices and inbox providers. Inbox rendering tests help you ensure that your emails are displaying as intended across your customers’ preferred device types and inbox providers. ================================================ FILE: content/docs/release-notes/2020-12-17.md ================================================ --- title: 'release notes 2020-12-17' date: 2020-12-17 releaseType: - ui - api --- ## Signup Form Error Handling Enhancements Signup forms will now display more elegant and helpful error messages when a user attempts to submit an invalid email address, leaves a required field blank, or fails to complete a CAPTCHA. Clear indications of where the error occurred in the form and legibility enhancements help users more quickly identify and fix form errors. ## Import Contacts via Compressed CSV Files You can now import up to 1 million contacts or 5GB of data, whichever is less, using compressed CSV files via the [Contacts API](https://sendgrid.api-docs.io/v3.0/contacts/import-contacts). The import endpoint also supports gzipped CSV files. ================================================ FILE: content/docs/release-notes/2021-01-07.md ================================================ --- title: 'release notes 2021-01-07' date: 2021-01-07 releaseType: - ui --- ## Delete Variations of an A/B Test You can now delete specific variations of an A/B test for a Single Send. If there is only one variation remaining after a second is deleted, the A/B test will turn off and the remaining variation will become the default. ================================================ FILE: content/docs/release-notes/2021-01-12.md ================================================ --- title: 'release notes 2021-01-12' date: 2021-01-12 releaseType: - ui --- ## Manually Select the Winner of an A/B Test You can now manually select the winner of an A/B test for a Single Send. The ability to manually select a test winner allows you to make more nuanced decisions about how to best engage your audience and prioritize the metrics that are most important to you, such as unsubscribes, spam reports, or conversions. To learn more about A/B testing, see [A/B Testing Your Single Send]({{root_url}}/ui/sending-email/a-b-testing/). ================================================ FILE: content/docs/release-notes/2021-01-13.md ================================================ --- title: "release notes 2021-01-13" date: 2021-01-13 releaseType: - api --- ## API Key and 2FA Requirements Enforced for remaining Free Users In order to enhance security for all of our users, Twilio SendGrid now requires customers on free plans to use API Key authentication on all API requests and SMTP configurations. Customers impacted by this breaking change will experience authentication errors when making API calls or SMTP requests using basic authentication with their username and password. Customers must also enable Two-Factor Authentication (2FA) for all users. Visit our docs for more information on [Upgrading to API Keys ]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/)and [Enabling Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). If you did not receive notifications about this change please [update your account email address]({{root_url}}/ui/account-and-settings/account/). ================================================ FILE: content/docs/release-notes/2021-01-19.md ================================================ --- title: 'release notes 2021-01-19' date: 2021-01-19 releaseType: - ui --- ## Duplicate A/B Test Variations You can now clone variations of an A/B test for a Single Send. You can have a maximum of 6 variations per test. ================================================ FILE: content/docs/release-notes/2021-02-17.md ================================================ --- title: "release notes 2021-02-17" date: 2021-02-17 releaseType: - api --- ## API Key and 2FA Requirements Enforced for Essentials Customers In order to enhance security for all of our users, Twilio SendGrid now requires customers on all Essentials plans to use API Key authentication on all API requests and SMTP configurations. Customers must also enable Two-Factor Authentication (2FA) for all users, including teammates. Visit our docs for more information on [Upgrading to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/) and [Enabling Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). If you did not receive notifications about this change please [update your account email address]({{root_url}}/ui/account-and-settings/account/). ================================================ FILE: content/docs/release-notes/2021-03-15.md ================================================ --- title: "release notes 2021-03-15" date: 2021-03-15 releaseType: - ui --- ## View Stats for Emails in a Marketing Campaigns Automation You can now see detailed performance data on individual emails within an Automation. Stats include information on emails triggered, emails delivered, clicks, opens, unsubscribes, bounces, and spam over time. Click Tracking data and Email Details are also available. To see performance data on emails in an Automation, navigate to the [Automations section of Marketing Campaigns](https://mc.sendgrid.com/automations), click into the detail view for an Automation, and select **View Stats** from the action menu to the right of an individual email in the Automation. ================================================ FILE: content/docs/release-notes/2021-03-24.md ================================================ --- title: "release notes 2021-03-24" date: 2021-03-24 releaseType: - api - ui --- ## API Key and 2FA Requirements Enforced for Paid Users In order to enhance security for all of our users, Twilio SendGrid now requires customers on all paid plans to use API Key authentication on all API requests and SMTP configurations. Customers must also enable Two-Factor Authentication (2FA) for all users, including teammates. Visit our docs for more information on [Upgrading to API Keys]({{root_url}}/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys/) and [Enabling Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/). If you did not receive notifications about this change please [update your account email address]({{root_url}}/ui/account-and-settings/account/). ================================================ FILE: content/docs/release-notes/2021-03-30.md ================================================ --- title: 'release notes 2021-03-30' date: 2021-03-30 releaseType: - api --- ## New Get Contacts by Email API Endpoint The new Get Contacts by Email endpoint allows you to retrieve one or more contacts by their email or alternate email addresses. This endpoint should be used when you know the email(s) you are searching for. If you need access to a larger set of contacts, please continue to use the export contacts functionality. ================================================ FILE: content/docs/release-notes/2021-04-13.md ================================================ --- title: 'release notes 2021-04-13' date: 2021-04-13 releaseType: - ui --- ## Support for "View in Browser" Links You can now include a “view in browser” link in your Marketing Campaigns emails using the Weblink Substitution Tag. The "view in browser" link points to an online version of your email, which will display your HTML as designed, protecting against potential email client rendering issues. This ensures recipients have a fallback to view your email, and provides them an option to share the email with friends using the link in addition to forwarding the email. ================================================ FILE: content/docs/release-notes/2021-05-19.md ================================================ --- title: 'release notes 2021-05-19' date: 2021-05-19 releaseType: - ui - api --- ## SAML 2.0 Single Sign-On (SSO) You can now integrate Twilio SendGrid with identity and access management platforms that support SAML 2.0 such as Okta, Duo, and Microsoft Azure. Twilio SendGrid SSO integration allows you to securely and centrally manage account permissions, including password requirements, multi-factor authentication, and employee offboarding. Twilio SendGrid SSO provides access to those who need it by mapping new Twilio SendGrid [Teammates]({{root_url}}/ui/account-and-settings/teammates/) to users in your SSO Identity Provider (IdP). Please note that each SSO user can access only one account or subuser during the Public Beta. Visit our [documentation]({{root_url}}/ui/account-and-settings/sso/) for more information on how to access and manage SSO permissions. ================================================ FILE: content/docs/release-notes/2021-05-25.md ================================================ --- title: 'release notes 2021-05-25' date: 2021-05-25 releaseType: - ui --- ## Support for undo and redo functionality in the Design and Code Editors You can now undo or redo recent changes made in the Design and Code Editors. To undo an action, use the undo arrow in the top navigation above the editor, or use the `Ctrl` or `Cmd` + `Z` keyboard shortcut. To redo an action, use the redo arrow in the top navigation above the editor, or use the `Ctrl` or `Cmd` + `Shift` + `Z` keyboard shortcut. You cannot undo/redo changes once you have left the browser session. ================================================ FILE: content/docs/release-notes/2021-06-02.md ================================================ --- title: 'release notes 2021-06-02' date: 2021-06-02 releaseType: - ui --- ## Exclude Recipients from Single Sends You can now exclude contacts from a Single Send based on list or segment membership. Any contacts on an exclusion list or segment who are also on any of your ‘Send To’ lists or segments will not receive the Single Send. You can exclude up to 5 segments and 50 lists. The ability to exclude contacts from a send can help with many marketing use cases. For example, a marketer might manage sending frequency by excluding contacts who were sent another marketing email within the past 3 days. Or, they might re-send a promotion to a set list of contacts, excluding those who were sent the first Single Send email. ================================================ FILE: content/docs/ui/account-and-settings/accessing-email-account-associated-with-sendgrid.md ================================================ --- seo: title: Accessing email account associated with SendGrid description: Accessing email account associated with SendGrid keywords: address, password, reset, maintenance, primary, forgot, lost, left title: Accessing email account associated with SendGrid weight: 0 group: account-management layout: page zendesk_id: 204982878 navigation: show: true --- The email address associated with your SendGrid account is required to receive notifications, billing alerts, and passwords reset emails. In the event that you lose access to this email address, you have several recovery options. 1. (Recommended) Have your email administrator re-create the email address associated with the SendGrid account in question, and then request a [password reset]({{root_url}}/ui/account-and-settings/resetting-your-username-and-password/) email. [SendGrid support](https://support.sendgrid.com/hc/en-us) can help if you don't know the email associated with your account. 2. If you are unable to recreate or obtain access to a lost email address, you can [create a new SendGrid account](https://sendgrid.com/transactional-email/pricing). In order to ensure data privacy and security, SendGrid will not be able to transfer data from an old account to a new account. We understand that this is inconvenient. If at all possible, re-creating the email address associated with your SendGrid account is preferred for this reason. 3. If neither of the above options fit your account recovery situation, please [contact our support team](https://support.sendgrid.com/hc/en-us) for assistance. ================================================ FILE: content/docs/ui/account-and-settings/account-compromised.md ================================================ --- seo: title: Compromised Account Recovery description: Compromised Account Recovery keywords: spam, password, security, hack, script, hacked, run, rogue, compromise, stolen, fraud title: Compromised Account Recovery weight: 0 group: security layout: page zendesk_id: 200182818 navigation: show: true --- If you believe your account has been compromised, please log in to your account and **_change your account username and password immediately_** under the [SendGrid Account Settings](https://app.sendgrid.com/settings/account) page. You will also need to update the username and password in your sending application or code in order to get mail flowing again. After changing your account username and password, please [contact support](https://support.sendgrid.com). We can help you investigate, and get our Compliance team involved if necessary. We'll try and help you isolate any issues or vulnerabilities with your SendGrid integration. We can also temporarily deactivate your account as well as delete any messages that are currently in a pending state within our system. In some cases your account may have already been preemptively Suspended to prevent damage to your reputation. In these cases please check your email for a notification from our Compliance department and respond directly to it to get the ball rolling. ================================================ FILE: content/docs/ui/account-and-settings/account-under-review.md ================================================ --- seo: title: Account Under Review description: If your account is suspended or is otherwise under review, learn how to bring your account into good standing. keywords: suspend, suspended, account, deactivated, banned, ban, deactivate, warn, warning, access, compromise, reactivate, stopped, stop, reactivated, turn, frozen, under, review, deactivated, compliance title: Account Under Review weight: 0 group: account-management layout: page navigation: show: true --- To preserve your reputation as a sender, SendGrid reviews accounts with apparent abnormal activity. Have you received a warning, suspension, deactivation, or ban notice from SendGrid? Please respond to any questions asked in the email notice. The fastest way to get your account reactivated is to respond directly to the ticket sent to your email address. In most cases, SendGrid Support cannot reactivate a warned, suspended, deactivated or banned account, so contacting them directly may delay reactivation. ## Stages of review Once your account is under review, SendGrid sends a notification to the address associated with your account indicating that it is in one of the following states: ### Warned The account maintains full sending functionality during a warning period. However, if we do not receive a response, your account may be suspended to prevent further risk to your sending reputation. Accounts with a warned status can still upgrade their usage plan, or create new subusers until the review has concluded to our satisfaction. ### Suspended SendGrid accepts and queues mail while the account is under review. The account holds mail until issues are resolved or up to 72 hours from the time of send. Any message queued for over 72 hours from sending expires and is not delivered. Delivered mail sent before the suspension is still functional, including open and click tracking, as well as link redirects. <call-out> An account in a suspended state continues to incur auto-renewal billing for your monthly subscription and any Marketing Campaigns contact storage. </call-out> ### Deactivated A deactivated SendGrid account cannot accept mail. Upon deactivation, SendGrid deletes any undelivered mail queued on the system. Click and Open tracking links are disabled in the deactivated account. Deactivated subusers are not accessible via the ‘log in as’ method available to parent accounts. However, deactivated subusers can still log in directly. <call-out> An account in a deactivated state continues to incur auto-renewal billing for your monthly subscription and any contacts storage. </call-out> ### Banned Banned accounts cannot access our system either through SendGrid.com or the API. Our system does not accept email requests from banned accounts. Dedicated IPs assigned to the account are removed. Related subusers are unable to send email or access their account. <call-out> An account in a banned state will stop any auto-renewal billing,though you will still be charged for any overages or Marketing Campaigns contact storage during the current month. </call-out> ### Reactivation Once you resolve all potential issues to our satisfaction, SendGrid will reactivate your service. Once activated, any queued messages will begin to process for delivery. ================================================ FILE: content/docs/ui/account-and-settings/account.md ================================================ --- layout: page weight: 0 group: account-management title: Account Details seo: title: Account Details description: Manage your SendGrid account settings keywords: account settings, profile settings, account details navigation: show: true --- Your profile provides SendGrid with the information we need to contact you with alerts and notifications as well as send and track your emails. _To edit your account information:_ 1. Click the edit icon next to the section you wish to change. 1. Once you have made your changes, click **Save**. This will only save the settings for that section. If you decide to abandon your changes, click **Cancel**. ## Your Account **First Name** - This is the first name of the representative from your company who should receive contacts from SendGrid. **Last Name** - This is the last name of the representative from your company who should receive contacts from SendGrid. **Email address** - This is the address where you will be contacted by SendGrid for any account-level alerts and notifications such as billing notifications. This must be a valid and active email address that you routinely check. <call-out> Once you've changed your contact email, you will need to confirm the new email address. You will be prompted to send a confirmation email to your inbox. Click **Send Confirmation Email** to finalize the change. **Make sure you click the link in the confirmation email to receive account updates at your new address**. </call-out> **Username** - Your SendGrid Username is used to access our API and our SMTP Relay. Changing this will immediately cause all of your calls to SendGrid to stop working. **Password** - The password criterion that your SendGrid password must include: 16 to 128 characters, at least one number, and one letter. ## Your Company **Company** - The name of your company. **Address 1** - The first line of your address. **Address 2** - The second line of your address, if your business has one. **City** - The city in which your company operates. **State** - The state or province in which your company operates. **Country** - The country in which your company operates. **Zip** - The zip code in which your company operates. <call-out> If you find that your scheduled sends or statistics seem like they are not quite correct, please double check your timezone. </call-out> **Timezone** - The [timezone]({{root_url}}/glossary/timezone/) in which your company operates. This setting will be used by other SendGrid functionality such as [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) and scheduling sends in [Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/). Please make sure that your timezone is set to the same as your business. **Website** - Your company’s website **Phone** - Your company’s phone number, where SendGrid can reach the representative that should be contacted. ================================================ FILE: content/docs/ui/account-and-settings/alerts.md ================================================ --- seo: title: Alert Settings description: Manage your SendGrid alerts keywords: sendgrid alerts, account alerts, deliverability alerts title: Alerts weight: 0 group: account-management layout: page navigation: show: true --- You can set up alerts to be sent to a specific email address on a recurring basis, whether for informational purposes or when specific account actions occur. For most alerts, you can choose to have the alert sent to you as needed, hourly, daily, weekly, or monthly. The information contained in your alert will be for the last period of the alert. For example, if you choose weekly for the statistics alert, you will receive the statistics for the last week. You can also change which email address these alerts are sent to. ## Add alert To add a new alert, click the large “+” or the “Add Alert” button. When the window appears, select the type of alert you would like to receive. Some alerts have options for being sent when a certain threshold is met or when a time period is met. ## Alerts ### Usage limit <call-out> Any accounts or subusers without an email limit alert on May 5th, 2015 or that were created after May 5th, 2015 will find this alert set up with a threshold of 90% on their account automatically. </call-out> You will receive an alert when you have used 90% of your current package’s number of emails. Subusers with recurring or nonrecurring email limits will have this alert set up automatically. Subusers who have unlimited emails will not have this alert set up automatically. ### statistics notifications An email containing your statistics sent at the frequency you define. For example: Weekly statistics will be sent once week and show the trailing week. Daily statistics will be sent every day, but with trailing 7 day statistics included. For more in depth statistics, we suggest using the [Event Webhook]({{root_url}}/for-developers/tracking-events/event/). ================================================ FILE: content/docs/ui/account-and-settings/api-keys.md ================================================ --- seo: title: Manage SendGrid API Keys description: Manage your SendGrid API Keys keywords: sendgrid API keys, email API Keys, mail API Keys, email credentials, send credentials title: API Keys weight: 0 group: account-management layout: page navigation: show: true --- Your application, mail client, or website can all use API (Application Programming Interface) keys to authenticate access to SendGrid services. They are the preferred alternative to using a username and password because you can revoke an API key at any time without having to change your username and password. We suggest that you use API keys for connecting to all of SendGrid’s services. ## Types of API keys _There are 3 different types of API keys:_ 1. **Full Access** allows the API key to access GET, PATCH, PUT, DELETE and POST endpoints for all parts of your account, excluding billing and Email Address Validation. 1. **Restricted Access** customizes levels of access for all parts of your account, excluding billing and Email Address Validation. 1. **Billing Access** allows the API key to access billing endpoints for the account. ### API key permissions During the API key creation process, you will be given the option of selecting scopes, or specific permissions, that you would like to assign to your new API key. These permissions restrict which areas of your account your API key will be able to access. When assigning permissions to your API key, you will be given the option to select one of the following levels of access: - **No Access** prevents the API key from accessing any endpoint within the selected permission. - **Read Access** allows the API key to access GET endpoints within the selected permission. - **Full Access** allows the API key to access GET, PATCH, PUT, DELETE, and POST endpoints within the selected permission. We require that you create a separate API key for making billing-related API calls. This segmentation adds an extra level of security by giving you more control over who has access to the various areas of your account. ## Managing API keys When viewing the API keys page, you will see a list of your current API keys along with the following information: **Name** - The name you defined for your API key. **API Key ID** - The way you would reference your API key for management through the API (e.g. editing or deleting a key). **Action** - Actions you can perform on your API keys, such as editing or deleting the key. ### Creating an API key 1. Navigate to **Settings** on the left navigation bar, and then select **API Keys**. 1. Click **Create API Key**. 1. Give your API key a name. 1. Select **Full Access**, **Restricted Access**, or **Billing Access**. 1. If you're selecting **Restricted Access**, or **Billing Access**, select the specific permissions to give each category. For more information, see [API key permissions](#api-key-permissions). 1. Click **Create & View**. 1. Copy your API key somewhere safe. For security reasons, do not put it directly in your code, or commit it somewhere public like GitHub. <call-out type="warning"> You will only be shown your API key one time. Please store it somewhere safe as we will not be able to retrieve or restore it. </call-out> <call-out> There is a limit of 100 API Keys per account. </call-out> ### Storing an API key in an environment variable Twilio SendGrid recommends storing your API key in an environment variable or a config file that is not stored in version control. When setting a variable in your program, that variable is readable by any person or system that can access the text file where it’s set. However, a variable that's confined to the environment where the code is executed, stored outside the program itself, is called an environment variable. Only people and programs with access to the environment can read the value assigned to an environment variable. This makes environment variables a more secure choice for storing credentials such as API keys. Once you assign your API key to an environment variable, you can then tell your program to look for and use that variable. Another benefit of this approach is the ability to set API keys with different permissions in different environments such as development, staging, and production without changing the code you deploy to those environments. The examples below show how to store your key in a variable named `SENDGRID_API_KEY`. You can find additional examples in the [Twilio Documentation](https://www.twilio.com/docs/usage/secure-credentials). To store your SendGrid API key, open your terminal or command prompt and add the following: <code-group langs="Unix, Windows"> ```unix export SENDGRID_API_KEY=the_key_you_copied_from_SendGrid ``` ```windows setx SENDGRID_API_KEY the_key_you_copied_from_SendGrid ``` </code-group> To then access the variable, you can use the convention provided by your coding language. <code-group langs="C#, Go, Java, Node.js, PHP, Python, Ruby"> ```c# var apiKey = Environment.GetEnvironmentVariable("SENDGRID_API_KEY"); ``` ```go apiKey := os.Getenv("SENDGRID_API_KEY") ``` ```java apiKey = System.getenv("SENDGRID_API_KEY"); ``` ```node.js const apiKey = process.env.SENDGRID_API_KEY; ``` ```php $apiKey = getenv('SENDGRID_API_KEY'); ``` ```python api_key = os.environ.get('SENDGRID_API_KEY') ``` ```ruby api_key = ENV['SENDGRID_API_KEY'] ``` </code-group> ## Editing an API key Click the action menu in the same row as the key you would like to edit. From here you can delete a key, making it completely inactive, or you can edit your key’s name and permissions. ## Deleting an API key <call-out type="warning"> Once you delete a key, it can no longer be used to access SendGrid’s services. </call-out> Click the action menu in the same row as the key you want to delete. Select **Delete**. This will delete the key permanently, making it inactive. SendGrid will reject any subsequent API calls using this deleted API key. ## Replacing an old API key with a new one 1. Locate the API key you would like to replace in your list of keys and select the action menu drop down at the right on the same row, then select **Delete API key**. 1. Next, [create an API key](#creating-an-api-key). 1. Replace the old API key with the new one in your code. <call-out> You may not give an API key greater permissions than you currently have. </call-out> ## Testing an API key You can test your newly created API key using cURL: ```curl curl -i --request POST \ --url https://api.sendgrid.com/v3/mail/send \ --header 'Authorization: Bearer YOUR_API_KEY_HERE' \ --header 'Content-Type: application/json' \ --data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Howdy!"}]}' ``` Look for a **202 Accepted** in the HTTP response headers. <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ================================================ FILE: content/docs/ui/account-and-settings/billing.md ================================================ --- layout: page weight: 0 group: billing title: Billing seo: title: Billing description: Manage your SendGrid billing settings keywords: billing, contacts, email credits, refund, plans, cancel, upgrade, downgrade navigation: show: true --- You can update your billing details on the Billing tab of the [Account Details page](https://app.sendgrid.com/account/billing) in the UI. You can update your plan details on the Products tab of the [Account Details page](https://app.sendgrid.com/account/products). For more information about understanding your bill, see [Reading your invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/). When you create or upgrade to a paid account, you add a credit card for automatic payments. This will allow Twilio SendGrid to make the recurring plan charges for your account without having to notify you each month of the bill. Twilio SendGrid relies on a PCI-DSS compliant 3rd party billing provider to store, process, and manage payment card processing. ## Payment methods Twilio SendGrid accepts credit or check cards. We charge accounts on a monthly basis; we do not offer prepayment, quarterly billing, or annual billing at this time. We do not accept PayPal, wire transfer, checks, prepaid cards, or any card requiring a PIN. You can update your card information, retry a failed payment, and export past invoices for your business on the Billing tab of your [Account Details](https://app.sendgrid.com/account/billing) page. It is also possible to change your package type and cancel your account from this page. ### Subusers Subusers under a free Marketing Campaigns plan will be able to upload only 2,000 contacts. Subusers under an Advanced Marketing Campaigns plan will be able to continue uploading contacts, and the parent account will pay for any overages the subuser may cause by exceeding the overall limit on the paid plan. <call-out type="warning"> If you are still on the **legacy Marketing Campaigns plan**, each subuser may store up to 2,000 contacts for free before we charge the same rate of $10.00 per 10,000 contacts each month. Any additional charges due for storing contacts on a subuser account will appear in the parent account's monthly invoice. </call-out> <call-out> We bill the parent account for each unique contact, regardless of how many lists or segments that contact appears on. However, if there are one or more subusers under a parent account, we bill the parent account for all unique contacts stored on each account, even for the same contacts stored on multiple subuser accounts. </call-out> ## Account Warning States If your account payments aren’t up-to-date, you may see one of the following warning states displayed in your account. ### Billing warned > “You have unpaid invoices. Please update your payment details or retry your payment.” This warns you that your service may be interrupted unless you settle any outstanding balance on your account. This warning may occur if the card on file for your account gets declined when we attempt to process your payment on the first of the month. To update your account, please update your credit card on file by logging into the Twilio SendGrid app and going to the Billing tab on your [Account Details page](https://app.sendgrid.com/account/billing). Update your card information and then click **Save**. Once you update the card on file, the payment processes automatically, and your account is unfrozen. ### Billing Frozen If you find your account is suddenly unable to send mail within the first week of the month, your account could be in a billing frozen state. This frozen state occurs when we attempt to process your payment on the first day of the month, but the card on file for your account gets declined. To reactivate your account, please update your credit card on file by logging into the Twilio SendGrid UI and going to the **Billing** tab on your [Account Details page](https://app.sendgrid.com/account/billing). Update your card information and then click **Save**. Once you update the card on file, the payment processes automatically, and your account is unfrozen. ## Marketing Campaigns Plans Each [Marketing Campaigns](https://sendgrid.com/pricing/) package will cover both contact storage and email sends that you use via Single Sends or Automation within Marketing Campaigns. Emails you send via the [Email API](#email-api-plans) will not be deducted from your Marketing Campaigns plan. ### Free Plan #### Features include: - Automation - Single Sends for one-time campaigns - Ticket Support - 3 Email Testing Credits per month - 1 Signup Form #### Limits: - 6,000 emails/month - Emails sent via Single Sends or Automation count toward your allotment. Any Single Sends you attempt to send that exceed your 6,000 email limit will send partially up to that limit. <call-out> For example, if you have 400 emails remaining and attempt to send a Single Send to an audience of 1,000, 600 of the emails will be dropped. Similarly, Automations will cease sending once you’ve hit 6,000 email sends via Marketing Campaigns in a month. If a contact meets the entry criteria of an Automation after you’ve reached your send limit, they will not receive any emails, and they will not be “caught up” once you upgrade your plan or a new month allotment increases. </call-out> - 2,000 contacts - Contacts, whether you attempt to upload them via CSV, or they are added via Signup Forms or the Contacts API, will be dropped if you exceed 2,000 total contacts. _What to do if you’ve reached your limit:_ You will be alerted when you have reached your limit each month. To keep your Automations and Signup Forms active, upgrade to the Basic or Advanced plan. Once you upgrade, your account will never be blocked due to limits, you’ll simply pay overages for any usage that exceeds your Basic or Advanced tier allotment. <call-out type="warning"> If you’re on the Free package and hit your contact allotment limit, any active Signup Forms will no longer add new contacts to your account. You will **not** be be able to recover these signups. When you upgrade, signups from Signup Forms will resume adding to your contacts. </call-out> ### Basic Plan #### Features include: * Single Sends for one-time campaigns * Ticket and chat * 10 Email Testing Credits per month with the option to purchase more * 5 Signup Forms * 1 Teammate * Access to Expert Services #### Limits: - 5,000 – 300,000 emails/month depending on the plan you purchase. Emails sent via Single Sends count towards your allotment. - Up to 100,000 contacts ### Advanced Plan #### Features include: - Automation - Single Sends for one-time campaigns - Ticket, chat, and phone support - 60 Email Testing Credits per month with the option to purchase more - 15 Signup Forms - 1,000 Teammates - Access to Expert Services - Subuser Management - Dedicated IP Included #### Limits: - 50,000 – 1 million+ emails/month depending on the plan you purchase. Emails sent via Single Sends or Automation count towards your allotment. - 200,000+ contacts If you exceed your plan allotment of contacts or overages you will be charged a [small amount]({{root_url}}/ui/account-and-settings/billing/#limits-and-overage-rates) per email sent and per contact stored above the limits of your current Marketing package. Any overage charges will appear on the invoice of the month _after_ any over-limit sending and contact storage occurs. ### Understanding Contact Counts in Marketing Campaigns #### Free Plan You can add and store up to 2,000 contacts to your account each month. The number you can add depends on whether you already have contacts stored in your account. For example, if you have 500 contacts in your account, and you haven’t added any yet this month, you can add up to 1,500 more contacts. If you _update or add new data about existing contacts_ in your Marketing Campaigns account, it will not count against the number of contacts you can add. If you _delete a contact and re-add them_, that is counted as a new add. #### Basic & Advanced Plans Your plan tier comes with an allotment of contacts that you can add to and store in your account each month. For example, if you’re on the Advanced 100K plan, you can add up to 100,000 contacts. The number you can add each month depends on whether you already have contacts stored in your account. For example, if you currently have 5,000 contacts in your account, and you haven’t added any yet this month, you can add up to 95,000 more contacts. If you _update or add new data about existing contacts_ in your Marketing Campaigns account, it does not count against the number of contacts you can add. If you _delete a contact and re-add them_, that is counted as a new add. If you exceed your allotment of contacts in a given month, you’ll be charged overages according to your chosen Marketing Campaigns package. ## Email API Plans <call-out type="warning"> Every email processed by SendGrid uses an email credit. Free, Essentials, Pro, and Premier accounts will see their email credits reset the 1st day of each month at 12:01 Pacific Time. </call-out> The [Email API package](https://sendgrid.com/pricing/) includes charges for any emails you send over the Twilio SendGrid Email API. Sending emails through the API with this package will not deduct from your Marketing Campaigns plan. ### Free #### Features include: - APIs, SMTP Relay, and Webhooks - Libraries and documentation - Delivery Optimization Tools - Transactional Template Editor - 3 days of Email Activity History - 3 Email Testing credits during the trial period - Ticket Support #### Limits: - 40,000 emails/day for your first 30 days - 100 emails/day indefinitely after your first 30 days are over - No ability to purchase additional Email Testing credits ### Essentials #### Features include: - APIs, SMTP Relay, and Webhooks - Libraries and documentation - Delivery Optimization Tools - Transactional Template Editor - 3 days of Email Activity History - Ticket and chat #### Limits: - Up to 100,000+ emails/month depending on the package you purchase. - No Email Testing access ### Pro #### Features include: - APIs, SMTP Relay, and Webhooks - Libraries and documentation - Delivery Optimization Tools - Transactional Template Editor - Dedicated IP Included - Subuser Management - 7 days of Email Activity History - 60 Email Testing credits with the ability to purchase more - Ticket, chat, and phone support #### Limits: - Up to 1.5 million+ emails/month depending on the package you purchase. ### Premier #### Features include: - APIs, SMTP Relay, and Webhooks - Libraries and documentation - Delivery Optimization Tools - Transactional Template Editor - Dedicated IP Included - Subuser Management - 7 Days of Email Activity History - 500 Email Testing credits with the ability to purchase more - Ticket, chat, and phone support ## Limits and Overage Rates _What to do if you’ve reached your limit_: You will be charged a small amount per-email for each email that you send beyond the limit of your current plan. Any overage charges will appear on the invoice of the month _after_ any over-limit sending and contact storage occurs. <call-out> Upgrading your account does NOT absorb already incurred overage charges, so make sure you are using the right package for your use case. </call-out> <call-out type="warning"> **Important:** If your SendGrid account is created through Microsoft Azure, Heroku or Google Cloud, these subscriptions do _not_ allow for overages. For pricing, billing and account package details for these types of SendGrid accounts, please refer to each of the partner's respective online resources. </call-out> ### Marketing Campaigns Overage Costs <table> <tr> <th colspan="3">Marketing Campaigns Overage Costs</th> </tr> <tr> <td colspan="3">The exact amount you pay will vary month-to-month if you exceed your plan allotment of email sends or contact storage.<br>If you go over your plan limits, here’s a breakdown of the overage costs you’ll incur:</td> </tr> <tr> <td>Plan Information</td> <td>Monthly Plan Limits</td> <td>Cost per Extra Email or Contact*</td> </tr> <tr> <td>Free</td> <td>2,000 contacts and 6,000 emails</td> <td>-</td> </tr> <tr> <td>Basic 5K</td> <td>5,000 contacts and 15,000 emails</td> <td>$0.0040</td> </tr> <tr> <td>Basic 10K</td> <td>10,000 contacts and 30,000 emails</td> <td>$0.0030</td> </tr> <tr> <td>Basic 20K</td> <td>20,000 contacts and 60,000 emails</td> <td>$0.0030</td> </tr> <tr> <td>Basic 50K</td> <td>50,000 contacts and 150,000 emails</td> <td>$0.0028</td> </tr> <tr> <td>Basic 100K</td> <td>100,000 contacts and 300,000 emails</td> <td>$0.0023</td> </tr> <tr> <td>Advanced 10K</td> <td>10,000 contacts and 50,000 emails</td> <td>$0.0075</td> </tr> <tr> <td>Advanced 20K</td> <td>20,000 contacts and 100,000 emails</td> <td>$0.0060</td> </tr> <tr> <td>Advanced 50K</td> <td>50,000 contacts and 250,000 emails</td> <td>$0.0060</td> </tr> <tr> <td>Advanced 100K</td> <td>100,000 contacts and 500,000 emails</td> <td>$0.0050</td> </tr> <tr> <td>Advanced 200K</td> <td>200,000 contacts and 1,000,000 emails</td> <td>$0.0050</td> </tr> <tr> <td colspan="3">*Taxes may apply.</td> </tr> </table> ### API Plans Overage Costs <table> <tr> <th colspan="3">API Plans Overage Costs</th> </tr> <tr> <td colspan="3">The exact amount you pay will vary month-to-month based on how many emails you send over your limits.<br>If you go over your plan limits, here’s a breakdown of the overage costs you’ll incur:</td> </tr> <tr> <td>Plan Information</td> <td>Monthly Plan Limits</td> <td>Cost per Extra Email*</td> </tr> <tr> <td>Free</td> <td>40,000 emails</td> <td>-</td> </tr> <tr> <td>Essentials 40K</td> <td>40,000 emails</td> <td>$0.00100</td> </tr> <tr> <td>Essentials 100K</td> <td>100,000 emails</td> <td>$0.00075</td> </tr> <tr> <td>Pro 100K</td> <td>100,000 emails</td> <td>$0.00100</td> </tr> <tr> <td>Pro 300K</td> <td>300,000 emails</td> <td>$0.00063</td> </tr> <tr> <td>Pro 700K</td> <td>700,000 emails</td> <td>$0.00051</td> </tr> <tr> <td>Pro 1.5M</td> <td>1,500,000 emails</td> <td>$0.00048</td> </tr> <tr> <td>Pro 2.5M, Pro 2.5M Legacy</td> <td>2,500,000 emails</td> <td>$0.00047</td> </tr> <tr> <td>Premier</td> <td>Custom</td> <td>-</td> </tr> <tr> <td colspan="3">*Taxes may apply.</td> </tr> </table> ## Requesting a refund You must meet both criteria below for a refund to be considered: - You have not used your account in the current calendar month. - You have no overages, and you have no contacts stored in Marketing Campaigns. Twilio SendGrid packages operate off of a monthly subscription model, not direct usage. We will not issue a refund if you have used your account in the same calendar month as your request. Instead, please cancel your account to avoid any future subscription charges. Refunds are only applicable to the current subscription charge on your account, not for overage or contact storage charges from the prior month. We hold our customers responsible for managing their account credit limits and contact storage. If you meet these conditions, please respond directly to the invoice email you have received, or email billing@sendgrid.com to begin the discussion about a possible refund. ## Changing your plan You can change your plan under the Email API or Marketing Campaigns sections on the "Your Products" tab of the [Account Details page](https://app.sendgrid.com/account/products). <call-out type="warning"> **Please note:** Downgrading from a paid Basic or Advanced Marketing Campaigns plan to a Free account will permanently delete all contacts associated with that account. You will need to reimport any contacts that you would like to use with your Free account. Other limits (like the number of Signup Forms or Email Testing credits available to you) will downgrade to the Free plan limits, keeping the most recently updated items when applicable. For example, if you have 10 Signup Forms and downgrade to a Free plan, we will keep your most recently updated Signup Form and remove the other 9. </call-out> ## Cancelling your account To cancel your account, go to the bottom of the "Your Products" tab of the [Account Details page](https://app.sendgrid.com/account/products), click **Cancel Account**, and follow the prompts. <call-out> When you cancel an account, it changes to a [free](https://sendgrid.com/free?mc=SendGrid%20Documentation) plan. </call-out> ## Additional Resources - [SendGrid Pricing](https://sendgrid.com/pricing/) - [Reading your invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/) ================================================ FILE: content/docs/ui/account-and-settings/cancel-your-account.md ================================================ --- layout: page weight: 0 group: account-management title: Canceling your account navigation: show: true seo: title: Canceling your account override: true description: Steps for canceling your SendGrid account using the SendGrid UI --- *To cancel your SendGrid account:* 1. Log into SendGrid.com 1. Select **Settings** and then click **Account Details**. 1. Select **Your Products**. 1. At the bottom of the page, click **Cancel Account** <call-out> Cancellations take full effect on the first day of the next calendar month, at which point your account will still be usable, but will be automatically downgraded to the Free package level. </call-out> Because it takes some time for the cancellation to take effect, Twilio SendGrid recommends you secure your account if you have not already: 1. Run a virus and malware scan on all computers and servers that access Sendgrid.com 1. Change your and all teammate account passwords. 1. Enable [two-factor authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/#setting-up-two-factor-authentication) for your account if you have not already. 1. Review recent IP's that logged into your account via the IP Access Management page in Account Settings. 1. Ensure any installed content management systems such as Apache, PHP, Perl, etc. are up to date. 1. Verify that your account credentials and API keys are not publicly listed on code repositories or associated comments on sites such as GitHub or BitBucket. If you run into issues Cancelling your account, please contact our [support team](https://support.sendgrid.com/). ================================================ FILE: content/docs/ui/account-and-settings/configuring-sign-in-with-apple.md ================================================ --- layout: page weight: 0 title: Configuring Sign in with Apple group: sender-authentication navigation: show: true seo: title: Configuring Sign in with Apple override: true description: Configure your authenticated domain to support Sign in with Apple and successfully deliver email to Apple's Private Email Relay addresses. keywords: Apple, Sign-in, Auth, Authorization, Authentication, Email, Relay, Proxy --- ## Introduction With the release of iOS 13, Apple began providing a feature called [Sign in with Apple](https://developer.apple.com/sign-in-with-apple/get-started/). This [OAuth](https://en.wikipedia.org/wiki/OAuth) feature allows users to authenticate with supported apps and websites using their Apple IDs. Sign in with Apple also provides a privacy feature called ["Hide My Email"](https://support.apple.com/en-us/HT210425#hideemail) that is particularly relevant to your SendGrid configuration. This page contains all the relevant SendGrid documentation required to successfully deliver messages to one of Apple’s [private email relay](https://developer.apple.com/documentation/signinwithapplejs/communicating_using_the_private_email_relay_service) addresses. For more information about Sign in with Apple, be sure to consult Apple’s [Developer Documentation](https://developer.apple.com/documentation). ## Delivering Mail to Private Addresses Generated by Apple To provide users with greater privacy, Sign in with Apple will create app-specific email addresses for users who prefer not to reveal their email addresses to a service. Apple does this with a private email relay. When a user chooses to hide their email address, Apple will create a unique address shared between only the user and the specific service. These private addresses follow the format: `<unique-alphanumeric-string>@privaterelay.appleid.com`. Apple will forward Messages sent to one of these relay addresses to the user’s actual email address. As a developer, you must configure your mail send according to requirements specified by Apple if you wish to support Sign in with Apple as an authentication provider. If you fail to follow Apple’s requirements, your messages to Apple’s private relay addresses will be bounced with the error “550 5.1.1 bad mailbox name.” This guide will step you through either a recommended configuration, which will work for most of you, or an alternate configuration for those of you with many authenticated domains. If you have thirty-two or more authenticated domains, read the prerequisites, and then jump to the [Alternative Configuration](#alternative-configuration) section. ## Prerequisites ### Domain Authentication Before you can configure Sign In with Apple, you need to complete [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) setup for the domain you will use when sending mail to Apple’s private addresses. The option to configure Sign in with Apple will show only for a fully authenticated domain, so be sure to complete this step first. <call-out type="warning"> When using the Alternative Configuration, it is critically important that you turn off automated security when completing the authentication process. Failure to do so will result in issues later in the configuration process. </call-out> ### Apple Developer Account To configure a [Private Email Relay Service](https://help.apple.com/developer-account/?lang=en#/devf822fb8fc) with Apple, you will also need a registered [Apple Developer](https://developer.apple.com/) account. ## Recommended Configuration Once you have successfully authenticated your domain, navigate to https://app.sendgrid.com/settings/sender_auth, and locate the configured domain. Click on the domain to navigate to its detail page. You should see a Settings section with a “Sign In with Apple Address” option and a button labeled “Show Address.” ![Sender Auth Domain Settings]({{root_url}}/img/sign-in-apple-sender-auth-settings.png 'Sender Auth Domain Settings') ![Sign in with Apple Tooltip]({{root_url}}/img/sign-in-apple-sender-auth-tooltip.png 'Sign in with Apple Tooltip') Click “Show Address” to reveal an allowed address that you can provide to Apple. This address should be the word “bounces,” a `+` symbol, your account number, the `@` symbol, and your authenticated domain. For example, your address may look like this: `bounces+12345678@email.example.com`. Copy the address from the information modal on the Sender Authentication page. ![Allowed email address]({{root_url}}/img/sign-in-apple-sender-auth-info-modal.png 'Allowed email address') ### Configuring your Apple Developer Account Log in to your Apple Developer account, and navigate to the [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources) section of your developer resources. Click on "Configure Sign in with Apple." In the section labeled “Individual Email Addresses,” paste the allowed address you copied from SendGrid earlier, and click “Register.” You should immediately see a green checkmark next to the email address. If you see an error, ensure that you completed domain authentication on the [SendGrid Sender Authentication page](https://app.sendgrid.com/settings/sender_auth). You should now be set to send messages to Apple's private relay addresses. <call-out type="warning"> If you are sending to Apple relay addresses from a sub user account, you must add the `bounces+subuserID@domain.com` (example) return path under "Individual Email Addresses" within the Apple console for each sub user and domain authentication combination from which you send in order for mail to be accepted by Apple properly. </call-out> ## Alternative Configuration Apple limits the number of addresses you can allow in the Apple Developer portal to [a total of thirty-two](https://help.apple.com/developer-account/?lang=en#/devf822fb8fc). If you have more than thirty-two verified domains, you will need to configure each of the addresses following the steps below. <call-out type="warning"> The majority of this setup and management occurs outside of the SendGrid console. SendGrid Support can help only with the steps that happen within your SendGrid account such as Domain Authentication setup. </call-out> ### Alternative Configuration Prerequisites Before you begin the four-step process, you will need access to the following: - The [Sender Authentication section](https://app.sendgrid.com/settings/sender_auth) of your Twilio SendGrid account - The DNS panel of the domain you’ll be sending from - The [Apple Developer portal](https://developer.apple.com/) for your app - An SSL certificate for your domain - A webserver to host files over HTTPS ### Domain Authentication When using the alternative configuration, be sure to turn off automated security. You will find this option in the settings section of the Sender Authentication page for your domain. Failure to do this will result in issues later in the configuration process. Please note that if you have an existing domain that is set to use automated security, and you want to configure this domain to work with Sign in with Apple, you must create a new authentication for that domain that does not use automated security. <call-out> Changing the root domain of your existing authentication will require rewarming that domain with Gmail. You want to avoid any changes to that root to avoid slowing this process. </call-out> ### Registering your Domain with Apple Once your domain authentication completes successfully, navigate to https://app.sendgrid.com/settings/sender_auth. Locate your authenticated domain and copy it. You will need this entire domain, including the subdomain. For example, with an authenticated domain of `email.example.com`, `email` is the subdomain. The entire domain is `email.example.com`. Log in to your [Apple Developer account](https://developer.apple.com/develop/), and navigate to the [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources) section. Select “More” from the sidebar, and click “Configure Sign In with Apple.” In the section titled “Domains and Associated Email Addresses,” paste the entire authenticated domain from your SendGrid setup. Next, click the “Register” button. The page will prompt you with a download link. Click this link to download a unique text file generated by Apple. ### Hosting Apple’s Association Text File Apple will use the text file you downloaded to verify that you control the domain associated with your mail send. You must host and serve this text file over https using a publicly available web server. For more information about hosting and serving files, you may need to contact your web host. Many domain providers also offer web hosting solutions and may be able to help you configure delivery over SSL. You can also obtain free SSL certificates using [Let's Encrypt](https://letsencrypt.org/). To ensure verification of your domain by Apple, you must serve the file at the path `/.well-known/apple-developer-domain-association.txt`. This path should follow the domain you authenticated with SendGrid and provided to Apple in the previous steps. If you authenticated `email.example.com`, the full URL used to access the unique text file would be `https://email.example.com/.well-known/apple-developer-domain-association.txt`. To break this down, the parts of this address are: - https — HTTP with an SSL certificate - email.example.com — Your full domain, including the subdomain - /.well-known/apple-developer-domain-association.txt — the path required by Apple Finally, log in to the service you use to manage your domain's [DNS]({{root_url}}/glossary/dns/) records. This may be a service such as Amazon Route 53 or a panel provided by the company where you purchased the domain. Add a new [A record]({{root_url}}/glossary/a-record/) to your domain containing the IP address of your web host. The A record needs to be located at the subdomain and domain you registered in the Apple Developer portal. <call-out> If your DNS provider and web hosting provider are the same, you may be able to create a subdomain. Creating a new subdomain will usually create a new web host with the necessary A record and a location for uploading the file. </call-out> Once you have added the A record and uploaded the file, paste the full URL path to your text file into your browser. Again, the URL should look something like `https://email.example.com/.well-known/apple-developer-domain-association.txt`. If the contents of the file you uploaded show in your browser, you’re ready to move on to the next step. ### Finish the Registration Back in the Apple Developer portal, go to the Sign In With Apple setup page, and click “Verify." You should see a green checkmark. If you receive an error, check that: - Your domain was authenticated properly with SendGrid - You uploaded the text file to the correct location - Your SSL certificate is configured correctly for your full domain You should now be set to send messages to Apple's private relay addresses. We recommend testing your implementation by signing into your app with your Apple ID and attempting to send an email to the app-specific email address that is issued. You can use [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) to verify that the message was delivered. If you have questions, we recommend reaching out to our [Support Team](https://support.sendgrid.com/hc/en-us). Again, please note that SendGrid Support is unable to assist you with the configuration of the services required outside of the SendGrid product. ================================================ FILE: content/docs/ui/account-and-settings/custom-ssl-configurations.md ================================================ --- seo: title: Adding a Custom SSL configuration title: Adding a Custom SSL configuration layout: page weight: 0 group: account-management navigation: show: true --- If you can't or don't want to use Content Delivery Networks when setting up SSL for click and open tracking, you can set up a custom SSL configuration. Before Adding a Custom SSL configuration, you need to set up a valid [link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) on your account. _To add a custom SSL configuration:_ 1. Prepare a proxy (like a web application, NGINX, or Amazon API Gateway) to take all traffic for `mailing.example.com` and forward it to `http://sendgrid.net` or `https://sendgrid.net`. 1. Set up the proxy to use HTTP or HTTPS. For HTTPS, provide a valid SSL certificate for `mailing.example.com` domain. 1. To forward traffic, set the `Host` HTTP header to `mailing.example.com` domain. 1. Point the CNAME record to your proxy. For example, `CNAME mailing.example.com proxy.example.com`. <call-out type="warning"> Don't validate the DNS record more than once. After changing the CNAME, a second validation will fail, and the authentication will stop working. </call-out> [Contact SendGrid Support](https://support.sendgrid.com/hc/en-us) to enable SSL click and open tracking. ================================================ FILE: content/docs/ui/account-and-settings/dedicated-ip-addresses.md ================================================ --- seo: title: Dedicated IP addresses description: Dedicated IP addresses keywords: sendgrid ip address, ips, ip addresses, purchase IPs, add, additional, more, new, IP, address, purchase, dedicated, account, another, need, IPs, warmup, sending, originating, originate, plan, reputation, monitoring, monitor title: Dedicated IP addresses weight: 0 group: ip-management layout: page navigation: show: true --- ## What are dedicated IP Addresses? An Internet Protocol (IP) address is a unique numerical address that defines a location. At Twilio SendGrid, you'll receive a dedicated IP address with either a Pro Email API plan or an Advanced Marketing Campaigns plan. If you have one of these accounts, you can purchase additional IP addresses dedicated to your account. For more information, see our [pricing](https://sendgrid.com/pricing/) page. Since you are the only one sending email over this IP, the sender reputation associated with this IP is determined purely by your sending practices. ## Why would I want a dedicated IP address? If you are sending any significant amount of email, we typically suggest sending your marketing and transactional emails from separate IP addresses. In order to do this, you'll need to set up [IP Pools]({{root_url}}/ui/account-and-settings/ip-pools/). In addition, it is strongly recommended to associate your sending domain with your new outbound IP address (provided to you by SendGrid). This is available at no extra cost and can be accomplished by [completing an rDNS setup for your dedicated IP]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/). We also suggest having at least 2 promotional IP addresses when your volume reaches 200-300K/month. ## Do I have a dedicated IP address? Depending on the plan you have chosen, you either have a dedicated sending IP address or you are using a shared sending IP address. - All Pro or Premier Email API and Advanced Marketing Campaigns customers get one dedicated sending IP by default. You can view any IPs attached to your account [here](https://app.sendgrid.com/settings/ip_addresses). - Free and Essential customers send from groups of shared IP addresses, where they group with senders of similar reputation and deliverability. Shared IPs addresses that these accounts send from can change without notice as your reputation changes, or as we make changes to IP groups to improve deliverability. In these cases, you will not be able to view your shared sending IP addresses from within your account. ## How many dedicated IPs should I have? Please see our document on [suggested IP allocation based on volume]({{root_url}}/assets/IPWarmupSchedule.pdf). ## Adding an additional dedicated IP address You can purchase an additional dedicated IP Address from the IP Addresses Settings page or from your [Plan & Billing Details](https://app.sendgrid.com/settings/billing) page. *To add an additional dedicated IP Address:* 1. In the left navigation, select **Settings** and then click **IP Addresses**. Here you'll see a list of your current d IPs. Your IPs in warmup will have a 'warmup' label. 1. Click **Add an IP Address**. 1. Select the number of IP addresses you would like to purchase. Under "Additional Options" you will find the following options: - **Use automated IP warmup**: SendGrid will gradually increase the amount of email sent over this IP. Note: It is best practice to [warm an IP address]({{root_url}}/ui/sending-email/ip-warmup-for-the-new-marketing-campaigns-experience/) over time before sending fully over that IP address. When using automated warmup, you must have at least one other warm IP that can handle the overflow traffic from the IP in warmup. - **Allow my parent account to send mail using these IP addresses**: You want your parent account to be able to send over this IP. If you are assigning this IP to a subuser and only want that subuser to have permission to send on this IP, leave this box unchecked. - **Allow my subusers to send mail using these IP addresses**: Select any subusers you would like to send on this IP address. After purchasing your IP, we strongly encourage you to set up reverse DNS. For more information about setting up reverse DNS, see [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/). <call-out> Only the Parent account or Teammates with either Billing or Admin permissions can purchase and add dedicated IPs. </call-out> <call-out> Additional IPs cost an extra $30 per additional IP per month. You may add 1 new IP address to your account per month through the user interface. For the addition of more than 1 IP address per month, please contact our support team. </call-out> ## Reputation Monitoring for dedicated IP Accounts Twilio SendGrid does not offer dedicated IP address reputation monitoring as a service. We do not manage the reputation of your dedicated IP address since your mail only sends via your dedicated IP. This means that you have ultimate control over the content that is being sent out and therefore are responsible for monitoring and maintaining its reputation and listing status. However, many services can help you maintain your IP’s reputation. The following are some third party tools available to assist you in maintaining your reputation: * [250ok](https://250ok.com/tools/blacklists/) * [Return Path](https://returnpath.com/request-a-demo-social/?sfdc=701000000006Za6&gclid=CIO88sevkcwCFRSPfgod6u8AXA) * [Sender Score](https://www.senderscore.org/blacklistlookup/) In addition, SendGrid offers [Expert Services](https://sendgrid.com/solutions/expert-services/) services to Pro and Premier accounts that can help with deliverability and onboarding. Services include how to maintain/improve domain and IP reputation, reviewing message content, dedicated IP configuration, and creating a custom IP warmup plan to name a few. ## Warming Up a dedicated IP Address For more information on warming up an IP Address, see [Warming up a dedicated IP]({{root_url}}/ui/sending-email/ip-warmup-for-the-new-marketing-campaigns-experience/). ## Assigning a dedicated IP address to a subuser Subusers cannot set up and add reverse DNS to their own dedicated IPs, but you can set it up for them and assign it to them. You can add a dedicated IP to a subuser when you [create the subuser]({{root_url}}/ui/account-and-settings/subusers/#create-a-subuser), or in the [subuser management](https://app.sendgrid.com/settings/subusers) page. ### Before you begin You need to have a [subuser]({{root_url}}/ui/account-and-settings/subusers/#create-a-subuser), and a [dedicated IP address]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/#adding-an-additional-dedicated-ip-address) you want to assign the subuser. *To assign a dedicated IP to a pre-existing subuser:* 1. Navigate to **Settings** and select **IP Addresses**. 1. Find and select the IP address you wish to add any of your subusers to, and then hover over the action menu. Click the pencil icon that says **Edit**. 1. Select the **Choose the Subusers** field and then click on any of the subusers you want to add from the dropdown menu to add them to the specified IP address. 1. Select **Save**. ## Additional Resources - [Warming up a dedicated IP]({{root_url}}/ui/sending-email/ip-warmup-for-the-new-marketing-campaigns-experience/) - [API IP Access Management]({{root_url}}/ui/account-and-settings/ip-access-management/) - [SendGrid billing information]({{root_url}}/ui/account-and-settings/billing/) <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ================================================ FILE: content/docs/ui/account-and-settings/dkim-records.md ================================================ --- seo: title: DKIM Records Explained description: DKIM Records Explained keywords: permission, dkim, sender verification, include, return, path, sender, permitted, forgery, spoofing, spoof, fail, failed, validation, validate title: DKIM Records Explained group: account-management weight: 0 layout: page navigation: show: true --- DomainKeys Identified Mail (DKIM) is an authentication standard used to prevent email spoofing. Specifically, DKIM attempts to prevent the spoofing of a _domain_ that's used to deliver email. DKIM employs the concept of a domain owner who controls the DNS records for a domain. When sending email with DKIM enabled, the sending server signs the messages with a private key. A domain owner also adds a DKIM record, which is a modified [TXT record](https://en.wikipedia.org/wiki/TXT_record), to the DNS records on sending domain. This TXT record will contain a public key that's used by receiving mail servers to verify a message's signature. The DKIM [public-key cryptography](https://www.twilio.com/blog/what-is-public-key-cryptography) process allows recipients to be confident of a sender's authenticity. ## DKIM mail flow To understand DKIM, it may be helpful to understand how email is sent when DKIM is added to the process. Imagine an email sent by `sender@example.com`. For DKIM to work properly, the following steps take place: 1. Before sending the message, the sending server signs the email using a private key. 2. When the message is delivered, the receiving server obtains the DKIM record from the DNS records for `example.com`. 3. The receiving server then uses the public key in the DKIM record to verify the message’s signature. 4. If the DKIM check passes, the receiving server can be confident the message was sent by the address in the `return-path` and wasn’t altered in transit. 5. If the DKIM check fails, the message is likely illegitimate and will be processed using the receiving server’s failure process. ![A diagram of the DKIM traffic flow described in the steps above this image]({{root_url}}/img/dkim_mail_flow.jpeg 'DKIM mail flow diagram') While DKIM authentication is an email best practice, it’s important to understand that a DKIM signature is limited in scope. It does not verify content or tell the receiver to treat the message any differently. Its main purpose is to help verify [Sender Identity]({{root_url}}/for-developers/sending-email/sender-identity/), which is an important factor (although not the only factor) when it comes to email delivery. You can authenticate with DKIM yourself, or the DKIM signature can be created by your sending message transfer agent ([MTA]({{root_url}}/glossary/mta/)). Setting up DKIM can be a complex process. If not done right, Internet service providers (ISPs) will block your email, particularly because incorrect implementation is a sign of a spammer. SendGrid automatically enables DKIM for all email to improve your email deliverability, whether you’re on a shared IP or a dedicated one. This is just one more example of how SendGrid helps thousands of customers follow email best practices to ensure maximum delivery for their emails. ## Automated Security and Your DKIM Signature When you set up an authenticated domain, you will be given the option of using automated or manual security. When you select automated security, SendGrid will manage your DKIM and [SPF]({{root_url}}/ui/account-and-settings/spf-records/) records for you. This means that whenever you make a change to your account that could impact your deliverability, such as adding a new dedicated sending IP address, SendGrid will automatically update your DNS settings and your DKIM signature. <call-out> SendGrid will always provide you with a custom DKIM signature. However, your custom DKIM signature is only automatically updated if you select automated security when [authenticating your domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). If you turn automated security OFF, you will be responsible for updating your DKIM signature whenever you make a change to your sending domain. </call-out> ### Example DKIM Record: Automated Security ON ```text subdomain.yourdomain.com. | CNAME | uXXXXXXX.wlXXX.sendgrid.net s1._domainkey.yourdomain.com. | CNAME | s1.domainkey.uXXX.wlXXX.sendgrid.net. s2._domainkey.yourdomain.com. | CNAME | s2.domainkey.uXXX.wlXXX.sendgrid.net. ``` ### Example DKIM Record: Automated Security OFF ```text em1234.yourdomain.com | MX | mx.sendgrid.net em1234.yourdomain.com | TXT | v=spf1 include:sendgrid.net ~all m1._yourdomain.com | TXT | k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPtW5iwpXVPiH5FzJ7Nrl8USzuY9zqqzjE0D1r04xDN6qwziDnmgcFNNfMewVKN2D1O+2J9N14hRprzByFwfQW76yojh54Xu3uSbQ3JP0A7k8o8GutRF8zbFUA8n0ZH2y0cIEjMliXY4W4LwPA7m4q0ObmvSjhd63O9d8z1XkUBwIDAQAB ``` <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## Additional resources - [Sender Identity](/for-developers/sending-email/sender-identity/) - [Domain Authentication](/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Single Sender Verification](/ui/sending-email/sender-verification/) - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) - [Troubleshooting Sender Authentication]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) ================================================ FILE: content/docs/ui/account-and-settings/dns-providers.md ================================================ --- seo: title: DNS Provider video tutorials description: Here are guides for setting up sender authentication with specific DNS providers keywords: sender verification, dns, provider, spf, dkim, dmarc, godaddy, hover, sender authentication title: DNS Provider video tutorials group: sender-authentication weight: 0 layout: page navigation: show: true --- ## Sender authentication with GoDaddy <iframe src="https://player.vimeo.com/video/149805633" width="700" height="400" frameborder="0" allowfullscreen=""></iframe> ## Sender authentication with Hover <iframe src="https://player.vimeo.com/video/158954155" width="700" height="400" frameborder="0" allowfullscreen=""></iframe> ================================================ FILE: content/docs/ui/account-and-settings/forced-password-reset-faq.md ================================================ --- seo: title: Forced Password Reset FAQ description: Forced Password Reset FAQ title: Forced Password Reset FAQ weight: 0 group: security layout: page navigation: show: false --- ## What is a credential stuffing attack? * Credential stuffing involves sourcing lists of previously compromised credentials that are traded and used by bad actors on the internet, to gain access to a given site or application. When a site is compromised, and credentials stolen, they’re often tested against other sites and applications because people often use the same email and password combination to log into multiple sites. ## Where can I look for evidence of bad activity in my account? * Although available features may vary by subscription, and also what individuals have chosen to set up on their account, careful attention should be paid to the following pages to identify unauthorized activity Including: * account settings * api key console pages * payment methods page * 2fa settings console page * Teammate management page * IP address (IPAM) management page * Webhooks management page * subusers management page ## What were the subject lines of the phishing emails? * This can vary by account. We suggest you review all the emails sent from your account over the past 30 days and scrutinize any subject lines that you don’t immediately recognize. ## Could a user gain access with username and password and send mail if we have IP access management set up on our account? * If you are using IP access management,you’ve taken extra precautions which would’ve prevented the attackers from accessing your account. IP access management effectively locks them out and prevents this kind of account takeover. ## How could a user gain access with username and password and send mail if we use API keys for V3 mail send? Did they create an API key? * In some cases the attackers used the account credentials to gain access to the account and then created a new API key to allow them to gain access to the account’s functionality and send email. In these cases we have taken the additional step of invalidating some recently created API keys to revoke sending access to the attackers. You can check your API Key status by visiting the API Key page in your account. ## How do you know we were affected? * Our team conducted a thorough investigation of the IP addresses accessing accounts and identified the IPs of bad actors accessing multiple accounts of which your account was one of them. ## I didn’t get an account reset email and when I click ‘Forgot Your Password’ I don’t receive an email. What happened? * If you’re unable to generate an account reset email then please contact our support team for further assistance. ## Why was I not notified before you reset my account and/or invalidated my API token? * It was important to reset the account passwords as soon as possible without alerting the bad actors. We’ve coordinated the timing of the notification with the reset to avoid alerting the bad actors. ## What services will be disrupted by a password reset? * Any services which use basic authentication, including access to the UI and API calls will be disrupted. ## How can I better protect my account? * In addition to 2FA we suggest all users take advantage of IP access management to lock down the IP addresses that can access a given account. If account owners work with a team of people we recommend the use of Teammates to restrict access and give the account admin greater flexibility to structure how their colleagues can or can not access the account. ================================================ FILE: content/docs/ui/account-and-settings/heroku-credentials.md ================================================ --- seo: title: Heroku Users - Find your SendGrid Credentials description: Learn how to find and recover your username/password as a SendGrid add-on user... keywords: heroku, password, reset, recover, username title: Heroku Users - Find your SendGrid Credentials weight: 0 group: account-management layout: page navigation: show: true --- ## Finding your existing username and password in the Heroku portal If you are a Heroku user using [the SendGrid add-on](https://addons.heroku.com/sendgrid), and would like to access the SendGrid web interface, or would just like to know your SendGrid account credentials; you can find them by doing the following from the Heroku interface: 1. In Heroku, go to your Apps, choose your SendGrid app ![]({{root_url}}/images/HerokuPW1.png "Heroku SendGrid App Screenshot") 1. Click **Settings** and then click **Reveal Config Vars**. ![]({{root_url}}/images/HerokuPW2.png "Heroku Config Vars Screenshot") <call-out> Editing your username or password here will not have an effect on your SendGrid account credentials. </call-out> ## Resetting your SendGrid add-on password Go to the [SendGrid Password Reset page](https://sendgrid.com/user/forgotPassword) and enter your SendGrid username, and click submit. An email will be sent to the email address on file with instructions on how to reset your password. If you don't know your SendGrid username, use the steps detailed above to find your username through the Heroku portal. <call-out> Resetting your password will not update the Config Vars of your SendGrid add-on in the Heroku portal. To update this please follow the directions above to pull up your add-on Settings/Config Vars. Then click the “edit” button to manually input your new password: </call-out> ![]({{root_url}}/images/HerokuPW3.png "Heroku Config Vars Edit Screenshot") ![]({{root_url}}/images/HerokuPW4.png) <call-out type="warning"> Resetting your SendGrid password may break any integrations you have that are currently using the existing credentials for authentication. </call-out> Alternatively, you can contact [Heroku Support](https://www.heroku.com/support) directly to request a password reset for the SendGrid add-on. ================================================ FILE: content/docs/ui/account-and-settings/hipaa-compliant.md ================================================ --- seo: title: Is SendGrid HIPAA Compliant? description: Sending email with SendGrid is not HIPAA compliant... keywords: security, hipaa, encryption, tls, ssl, secure, GLBA, gramm leach, bliley, act, health, law title: Is SendGrid HIPAA Compliant? weight: 0 group: security layout: page zendesk_id: 200182978 navigation: show: true --- **No, we are not.** SendGrid does not natively support HIPAA compliant data transmission. We do not offer any encryption or security measures surrounding message transmission beyond those included in the SMTP RFC, which was not designed with HIPAA compliancy in mind. We suggest that you encrypt the message body of your emails on your end if you are concerned about being compliant with HIPAA, or offer a secure download link for secure documents rather than transmitting them directly via email. From our [Terms of Service](https://sendgrid.com/policies/tos/): >SendGrid does not intend uses of the Service to create obligations under The Health Insurance Portability and Accountability Act of 1996 (“HIPAA”), the Gramm-Leach-Bliley Act (“GLBA”) or similar laws and makes no representations that the Service satisfies the requirements of such laws. If You are (or become) a Covered Entity or Business Associate (as defined in HIPAA) or a Financial Institution (as defined in GLBA), You agree not to use the Service for any purpose or in any manner involving Protected Health Information (as defined in HIPAA) or Nonpublic Personal Information (as defined in GLBA). ================================================ FILE: content/docs/ui/account-and-settings/how-to-set-up-domain-authentication.md ================================================ --- layout: page weight: 0 title: How to set up domain authentication group: sender-authentication navigation: show: true seo: title: How to set up domain authentication override: true description: Set up sender authentication to improve your deliverability and security of your emails. --- <iframe src="https://player.vimeo.com/video/265066856" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## What is domain authentication? Domain authentication, formerly known as domain whitelabel, shows email providers that SendGrid has your permission to send emails on your behalf. To give SendGrid permission, you point DNS entries from your DNS provider (like GoDaddy, Rackspace, or Cloudflare) to SendGrid. Your recipients will no longer see the “via sendgrid.net” message on your emails. Even though this is a small change from your recipient's perspective, this change has a huge positive impact on your reputation as a sender and your email deliverability. Email service providers distrust messages that don't have domain authentication set up because they can not be sure that the message comes from you. Explicitly stating that it comes from you increases your reputation with email service providers which makes it much less likely that they will filter your mail and not allow it get to your recipient's inbox, which increases your deliverability. You are also explicitly showing your recipients that this email comes from you, so they are less likely to mark your mail as spam. ## Key terminology ### DNS DNS stands for Domain Name System. This is a naming system for domains on the internet. When SendGrid refers to your DNS, we are talking about your domain name that you want to send emails from, or that you want to link images from. When we talk about your DNS provider, we are talking about the service that hosts your domain name. For example, GoDaddy, Rackspace, or Cloudflare. For more information about DNS, see our [DNS glossary page]({{root_url}}/glossary/dns/). ### DKIM DKIM stands for DomainKeys Identified Mail which was designed to help email providers prevent malicious email senders by validating email from specific domains. As one of the most popular email authentication methodologies, it works by using cryptographic technology that adds a digital signature to your message header. This DKIM signature validates and authorizes your domain name in the eyes of the receiver. The DKIM signature is created using a unique string of characters stored as a public key. When your email is received, the public key is retrieved through the DNS and decrypted by the receiver to allow them to confidently verify the identity of your domain. For more information about DKIM, see our [DKIM glossary page]({{root_url}}/glossary/dkim/). ### SPF Sender Policy Framework (SPF) is an email authentication standard developed by AOL that compares the email sender’s actual IP address to a list of IP addresses authorized to send mail from that domain. The IP list is published in the domain’s DNS record. For more information about SPF, check out our [SPF glossary page]({{root_url}}/glossary/spf/). ### CNAME The CNAME record creates an alias for subdomain.yourdomain.com and points to sendgrid.net. The CNAME is needed for our click and open tracking features in order for those statistics to be routed back to your SendGrid account. This will also be what your messages are signed by, so your recipients will be able to see what you have chosen for your CNAME. You set up the CNAME files that SendGrid provides with your DNS host. For more information about CNAME, see our [CNAME glossary page]({{root_url}}/glossary/cname/). ## Setting up domain authentication ### Before you begin To set up domain authentication, you must submit the DNS records provided by SendGrid to your DNS or hosting provider (for example, GoDaddy, Hover, CloudFlare, etc.). First, figure out who your hosting provider is and if you have access. If you don't have access to your DNS or hosting provider, you should figure out who in your company has this access before you begin setting up domain authentication. _To set up domain authentication:_ 1. In the SendGrid UI, select [Settings > Sender Authentication](https://app.sendgrid.com/settings/sender_auth). 2. In the domain authentication section, click **Get Started**. 3. Next, add in information about your DNS host, and indicate whether you also want to set up link branding. Click **Next**. For more information about link branding, check out [What is link branding?]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/#what-is-link-branding). 4. Fill in the domain that you want to send from and add advanced settings as needed. Make sure that you only enter the name of your root domain. Do not include `www` or `http://www` in this field. Your domain needs to match the domain of your FROM address on the emails you are sending out. For example, if I am sending an email from `example@sendgrid.com`, I would set my domain authentication domain to be `sendgrid.com`. Click **Next**. For more information about advanced settings, see [Advanced settings](#advanced-settings). 5. Next, you need to add all of the CNAME records on this screen to your DNS host. This process varies depending on your DNS host. For videos on how to add your CNAME to some popular DNS service providers, check out these [videos]({{root_url}}/ui/account-and-settings/dns-providers/). If you don't have access to modify your companies DNS records, you can also email a request to a co-worker. This email includes a direct link to the CNAME records. This link does expire. The recipient doesn't need login access to your SendGrid account. <call-out> GoDaddy, Amazon Route 53, and Namecheap, are among providers that automatically add your domain to your new DNS record values, resulting in a CNAME entry with too much information that fails authentication. An example of this would be **em123.yourdomain.com.yourdomain.com**. Be sure to check your CNAME for this behavior if your domain doesn't validate initially. Below is an example of the CNAME values under the HOST column as they are displayed and how you will need to enter them into your DNS management with one of these providers: - HOST/NAME **em123.yourdomain.com** . ENTER CNAME RECORD HOST/NAME AS: **em123** - HOST/NAME **s1.\_domainkey.yourdomain.com**  ENTER CNAME RECORD HOST/NAME AS: **s1.\_domainkey** - HOST/NAME **s2.\_domainkey.yourdomain.com**  ENTER CNAME RECORD HOST/NAME AS: **s2.\_domainkey** Entries made in the VALUE or POINTS TO field do not need to be changed. </call-out> <call-out> If you [turn off automated security](#using-automated-security), you add TXT and MX records in this step instead of CNAME records. </call-out> It can take up to 48 hours for the records to verify after you upload them into your DNS host, so you will likely have to come back later to verify. ### Verifying your DNS Once you add the CNAME records to your DNS host, return to the [Sender authentication page](https://app.sendgrid.com/settings/sender_auth) and click **Verify**. <call-out> If you click verify, and only half of your CNAME records verify, this usually means that you need to wait a bit longer. It's also possible that you entered one of your records incorrectly. For other troubleshooting information, see [Sender authentication troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/). </call-out> Any time that you send an email with a FROM address whose domain matches the domain set in the domain authentication, SendGrid applies that domain to your email. You only need to update your domain authentication if you want to update the domain you are emailing from. ## Advanced settings <iframe src="https://player.vimeo.com/video/267486083" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ### Using automated security Automated security allows Twilio SendGrid to handle the signing of your DKIM and authentication of your SPF for your outbound email with CNAME records. This allows you to add a dedicated IP address or update your account without having to update your SPF record. Automated security defaults to **On**. If your DNS provider does not accept underscores in CNAME records, you will have to turn off Automated Security to use MX and TXT records. When Automated Security is **On**, SendGrid generates 3 different CNAME records. In a later step of setting up domain authentication, you give these records to your DNS provider, and then you verify that they upload correctly. If you select **Off**, we generate 1 MX record and 2 TXT records. In a later step of setting up domain authentication, you give these records to your DNS provider, and then you verify that they upload correctly. <call-out> If you turn off automated security, you are responsible for managing and updating the MX and TXT records yourself. </call-out> ### Using a custom return path Use a custom return path to customize your subdomain. _To use a custom return path:_ When you are in the process of authenticating a domain, and on the screen where you input domain settings, open the advanced settings, select **Use a custom return path** and input letters or numbers to build a custom return path. If you don't select these, SendGrid automatically selects them for you. Make sure the characters you select are different from what SendGrid assigned you initially. ### Using a custom DKIM selector Use a custom DKIM selector if you want to authenticate a single domain multiple times. This works by adding the custom selector to the domain as a custom subdomain. _To use a custom DKIM selector:_ When you are in the process of authenticating a domain, and on the screen where you input domain settings, open the advanced settings, select **Use a custom DKIM selector** and input 3 letters or numbers to build a custom subdomain. If you don't select these, SendGrid automatically selects them for you. Make sure the 3 characters you select are different from your original selection. For example, you could use `org` or `001`. ### Assigning a subuser By assigning an authenticated domain to one of your subusers, you can give them the benefit of improved authentication and security, but also separate from the sending reputation of your parent account. If you assign a subusers domain, they can't edit or delete it. _To assign an authenticated domain to a subuser:_ When you are in the process of authenticating a domain, and on the screen where you input domain settings, open the advanced settings, select **Assign to a subuser**, and select a subuser to assign to that domain. ## Migrating from legacy Domain Authentication (Whitelabel) If you authenticated a domain (whitelabel) before 2015, your domain will still work. However, if you need to change or update it, you need to delete it and recreate it as an authenticated domain in our new system. If you set up a whitelabel after 2015, it has been automatically migrated to our new domain authentication system. ## Additional resources - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) - [Troubleshooting Sender Authentication]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) - [Configuring Sign in with Apple]({{root_url}}/ui/account-and-settings/configuring-sign-in-with-apple/) ================================================ FILE: content/docs/ui/account-and-settings/how-to-set-up-link-branding.md ================================================ --- layout: page weight: 0 title: How to set up link branding group: sender-authentication navigation: show: true seo: title: How to set up link branding override: true description: Set up link branding to improve your deliverability and security of your emails. --- <iframe src="https://player.vimeo.com/video/265136044" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## What is link branding? Email link branding allows all of the click-tracked links and opens tracked images in your emails to be from your domain instead of from sendgrid.net. Spam filters and recipient servers look at the links within emails to determine whether the email looks trustworthy enough to deliver - they use the reputation of the root domain to determine whether the links can be trusted. Implementing link labeling helps in email deliverability because you are no longer relying on click tracking going through a domain that you do not control. ## Key terminology ### DNS DNS stands for Domain Name System. This is a naming system for domains on the internet. When SendGrid refers to your DNS, we are talking about your domain name that you want to send emails from, or that you want to link images from. When we talk about your DNS provider, we are talking about the service that hosts your domain name. For example, GoDaddy, Rackspace, or Cloudflare. For more information about DNS, see our [DNS glossary page]({{root_url}}/glossary/dns/). ### CDN A CDN (content delivery network) is a network that delivers the content of webpages to the end user. The network selects the servers for delivery based on the location of the end user, the originating location of the webpage and the location of the content delivery server. Content Delivery Networks are a great mechanism that you can use to serve up content very quickly and easily across multiple mediums as well as handle security certificates for you. We suggest [CloudFlare]({{root_url}}/ui/sending-email/content-delivery-networks/#using-cloudFflare), [Fastly]({{root_url}}/ui/sending-email/content-delivery-networks/#using-fastly), or [KeyCDN]({{root_url}}/ui/sending-email/content-delivery-networks/#using-keycdn) when using Content Delivery Networks with SendGrid. ### CNAME The CNAME record creates an alias for subdomain.yourdomain.com and points to sendgrid.net. The CNAME is needed for our click and open tracking features in order for those statistics to be routed back to your SendGrid account. This will also be what your messages are signed by, so your recipients will be able see what you have chosen for your CNAME. You set up the CNAME files that SendGrid provides with your DNS host. For more information about CNAME, see our [CNAME glossary page]({{root_url}}/glossary/cname/). ### Before you begin To set up link branding, you must submit the DNS records provided by SendGrid to your DNS or hosting provider (for example, GoDaddy, Hover, CloudFlare, etc.). First, figure out who your hosting provider is and if you have access. If you don't have access to your DNS or hosting provider, you should figure out who in your company has this access before you begin setting up link branding. <call-out> Note that you can also set up link branding when you set up your domain authentication and you may not need to set it up again. </call-out> _To set up and verify link branding:_ 1. In the SendGrid UI, select [Settings > Sender Authentication](https://app.sendgrid.com/settings/sender_auth). 2. In the link branding section, click **Get Started**. 3. Next, add in information about your DNS host. Click **Next**. 4. Enter the domain that you want to brand the links and images with and add advanced settings. Make sure that you only enter the name of your root domain. Do not include `www` or `http://www` in this field. Your domain needs to match the domain of your from address on the emails you are sending out. For example, if I am branding with the domain `example.sendgrid.com`, I would set my link branding domain to be `sendgrid.com`. Click **Next**. For more information about advanced settings, see [Advanced settings](#advanced-settings). 5. Next, you need to add all of the CNAME records on this screen to your DNS host. This process varies depending on your DNS host. For videos on how to add your CNAME to some popular DNS service providers, check out these [videos]({{root_url}}/ui/account-and-settings/dns-providers/). If you don't have access to modify your companies DNS records, you can also email a request to a co-worker. This email includes a direct link to the CNAME records. This link does expire. The recipient doesn't need login access to your SendGrid account. <call-out> A recent change with how GoDaddy handles new DNS record values automatically adds your domain, resulting in a CNAME entry with too much information and a failure when trying to complete Link Branding. An example of this would be **url1234.yourdomain.com.yourdomain.com.** Below is an example of the CNAME values under the HOST column as they are displayed in step 5 and how you will need to enter into your GoDaddy DNS Management: HOST/NAME **url1234.yourdomain.com** ENTER CNAME RECORD HOST/NAME AS: **url1234** HOST/NAME **1234567.yourdomain.com** ENTER CNAME RECORD HOST/NAME AS: **1234567** Entries made in the VALUE or POINTS TO field do not need to be changed. </call-out> <call-out> When configuring CNAME records in CloudFlare, check the bottom of the DNS settings page and make sure "CNAME Flattening" is set to "Flatten CNAME at root". </call-out> Now links and images in your emails are from your custom domain. You only need to update your link branding if you want to update the domain that appears in the links in your email. It can take up to 48 hours for the records to verify after you upload them into your DNS host, so you will likely have to come back later to verify. ### Verifying your DNS Once you add the CNAME records to your DNS host, return to the [Sender authentication page](https://app.sendgrid.com/settings/sender_auth) and click **Verify**. <call-out> If you click verify, and only half of your CNAME records verify, this usually means that you need to wait a bit longer. It's also possible that you entered one of your records in incorrectly. For other troubleshooting information, see [Sender authentication troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/). </call-out> Any time that you send an email with image or links that match the branded link, SendGrid applies that link to your email. You only need to update your link branding if you want to update the links used in your emails. ## Advanced settings ### Using a custom subdomain for links _To customize your subdomain:_ When you are in the process of branding a link, and on the screen where you input domain settings, open the advanced settings, select **Custom subdomain for links** and input letters or numbers to build a custom domain. If you don't select these, SendGrid automatically selects them for you. Make sure the characters you select are different from what SendGrid assigned you initially. ### Assigning a subuser By assigning an authenticated domain to one of your subusers, you can give them the benefit of improved authentication and security, but also separate from the sending reputation of your parent account. If you assign a subusers domain, they can't edit or delete it. _To assign an authenticated domain to a subuser:_ When you are in the process of authenticating a domain, and on the screen where you input domain settings, open the advanced settings, select **Assign to a subuser**, and select a subuser to assign to that domain. ## Migrating from legacy Whitelabel If you authenticated a domain (whitelabel) before 2015, your domain will still work. However, if you need to change or update it, you need to delete it and recreate it as an authenticated domain in our new system. If you do set up a new branded link, make sure to keep the same subdomain for domain authentication, but then use a different one for link branding. If you set up a whitelabel after 2015, it has been automatically migrated to our new sender authentication system. ## Additional resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) - [Troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) ================================================ FILE: content/docs/ui/account-and-settings/how-to-set-up-reverse-dns.md ================================================ --- layout: page weight: 0 title: How to set up reverse DNS group: sender-authentication navigation: show: true seo: title: How to set up reverse DNS override: true description: Set up reverse DNS to improve your deliverability and security of your emails. keywords: reverse DNS, rDNS --- <!-- OUTDATED REVERSE DNS VIDEO --!> <!-- <iframe src="https://player.vimeo.com/video/265831363" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> --> <call-out> You can only set up reverse DNS if you have a [dedicated IP]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/). </call-out> ## What is reverse DNS? Setting up reverse DNS on an IP address allows mailbox providers to verify the sender when they do a reverse DNS lookup upon receipt of the emails you send. When you update your DNS provider with a DNS record provided by SendGrid, and then send mail over your IP, the recipient's email service provider performs a reverse DNS lookup (rDNS) using an A Record (address record). An A Record maps your domain to your IP address. When a mailbox provider looks up your A Record, they see your SendGrid IP address. When they look at your IP address, they see the rDNS that matches your A Record. This circular checking proves your SendGrid IP association with your domain and your domain association with your SendGrid IP. ## Key terminology ### IP Address An Internet Protocol (IP) Address is a unique numerical address that defines an internet location. These addresses have 4 sets of numbers separated by periods. For example, 127.0.0.1 is an IP address. At SendGrid, you can be on a shared IP address, or you can have a dedicated IP address. We recommend a dedicated IP address for people sending high volumes of email or for people who want control over the quality of mail sent on the same IP as theirs. The aggregate performance of all the senders who use the IP determines its reputation. ### DNS DNS stands for Domain Name System. This is a naming system for domains on the internet. When SendGrid refers to your DNS, we are talking about your domain name that you want to send emails from. When we talk about your DNS provider, we are talking about the service that hosts your domain name. For example, GoDaddy, Rackspace, or Cloudflare. For more information about DNS, see our [DNS glossary page]({{root_url}}/glossary/dns/). ### A Record The A Record (address record) links your dedicated IP address to your chosen domain. It does this by mapping your domain to your IP address through records that you export from SendGrid and upload into your DNS host. If your domain+subdomain is `marketing.example.com`, and your dedicated IP address is `101.10.10.101`, setting up the SendGrid A Record links your domain with your dedicated IP address - so anything sent over your domain associates with your dedicated IP, and anything sent over your dedicated IP associates with your domain. ### Subdomain A subdomain is a prefix appended to your domain and used for tracking and reporting on your validated IP. Your subdomain cannot be the same as your other IP subdomains. It's a good idea to check your current DNS settings with your DNS provider to confirm that the subdomain you would like to use is available. Try to pick a name for this subdomain that represents the type of email you will send using it. For example, "marketing" or "billing". Do not use underscores in your subdomain. We create your DNS records based on the subdomain, and DNS providers do not accept DNS records that contain underscores. <call-out type="warning"> Your sending reputation is determined by the reputation of your root, or top-level, domain. This is true even if you have several different subdomains with the same authenticate domain. For example, both `billing.example.com` and `marketing.example.com` will share the reputation of `example.com`. </call-out> ### Before you begin To set up reverse DNS, you must submit the DNS records provided by SendGrid to your DNS or hosting provider (for example, GoDaddy, Hover, CloudFlare, etc.). First, figure out who your hosting provider is and if you have access. If you don't have access to your DNS or hosting provider, you should figure out who in your company has this access before you begin setting up reverse DNS. *To set up and verify reverse DNS:* 1. In the SendGrid UI, select [Settings > Sender Authentication](https://app.sendgrid.com/settings/sender_auth). 2. In the reverse DNS section, click **Get Started**. 3. Next, select the IP to set up reverse DNS. 4. Add a subdomain. For more information about picking a subdomain, see [Subdomains](#subdomain). 5. Select or enter a domain you want to associate with the IP. Make sure that you only enter the name of your root domain. Do not include `www` or `http://www` in this field! Your domain needs to match the domain of your from address on the emails you are sending out. For example, if I am setting up the domain `example.sendgrid.com`, I would set my domain to be `sendgrid.com`. Click **Save** and then **Confirm**. An individual IP address can only have one reverse DNS set up. 6. Next, you need to add all of the A Records on this screen to your DNS host. This process varies depending on your DNS host. For videos on how to add your A Records to some popular DNS service providers, check out these [videos]({{root_url}}/ui/account-and-settings/dns-providers/). <call-out> A recent change with how GoDaddy handles new DNS record values automatically adds your domain, resulting in an A record with too much information and a failure when trying to complete reverse DNS. An example of this would be **o1.test.yourdomain.yourdomain.com**. Below is an example of the A record values under the HOST column as they are displayed in step 6 and how you will need to enter into your GoDaddy DNS Management: HOST/NAME: **01.test.yourdomain.yourdomain.com** ENTER A RECORD HOST/NAME AS: **O1.test** Entries made to the VALUE or POINTS TO field to not need to be changed. </call-out> <call-out> If you plan to send from multiple domains, you should set up reverse DNS for at least one IP address per domain. </call-out> It can take up to 48 hours for the records to verify after you upload them to your DNS host, so you will likely have to come back later to verify. ### Verifying Once you add the A Records to your DNS host, return to the [Sender authentication page](https://app.sendgrid.com/settings/sender_auth) and click **Verify**. <call-out> If you click verify, and only half of your A name records verify, this usually means that you need to wait a bit longer. It's also possible that you entered one of your records in incorrectly. For other troubleshooting information, see [Sender authentication troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/). </call-out> Now your dedicated sending IP is associated with your domain. You only need to update your reverse DNS if you add additional dedicated IPs to your account. ## Reverse DNS for a subuser Only a parent account can set up reverse DNS for an IP address. For a subuser account to have an IP that has reverse DNS set up, the parent account needs to buy the IP, set up reverse DNS and then [assign the IP to the subuser]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/#assigning-a-dedicated-ip-address-to-a-subuser). ## What do I do if I have more than 10 IPs? There is a character limit in SPF (sender policy framework) records that means that if you have more than 10 IP addresses, they will not fit in the record. When this is true, we will provide you with the generic SendGrid SPF record which includes all IPs at SendGrid, not just yours. If you would like to secure your SPF record only to include your IPs, you can chain multiple SPF records together manually. For more information see Open SPF’s [website](http://www.open-spf.org/). ## Additional resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [Troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) ================================================ FILE: content/docs/ui/account-and-settings/inbound-parse.md ================================================ --- seo: title: Inbound Parse Webhook description: Manage your Inbound parse settings keywords: inbound parse, inbound parse webhook, parse settings, inbound parse settings title: Inbound Parse weight: 0 group: account-management layout: page navigation: show: true --- SendGrid’s Inbound Parse Webhook allows you to receive emails that get automatically broken apart by SendGrid and then sent to a URL of your choosing. SendGrid will grab the content, attachments, and the headers from any email it receives for your specified hostname. Please see our [Inbound Parse Webhook]({{root_url}}/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/) technical docs for more information about how to handle the information coming to you from SendGrid’s Inbound Parse. ## Manage inbound parse You can see all of your hostname and URL pairs that you have set up in the table on the main [Inbound Parse page](https://app.sendgrid.com/settings/parse). From there, you can use the gear icon on the right side of each pair to remove and edit the Inbound Parse Webhook settings. ## Add host and URL The Inbound Parse Webhook requires a hostname, where the emails will be sent, and the URL where SendGrid will POST the data it builds from every incoming email. **Host Name** - The domain where you have pointed an MX Record so addresses at this hostname can receive email. For example: parse.yourdomain.com. When entering your host name (also referred to as the receiving domain), the subdomain-domain combination must be globally unique, and the domain must be one of your authenticated domains. **URL** - The URL for the Inbound Parse Webhook to POST all parsed email information. **Spam Check** - Inbound Parse will check incoming emails for spam, then assign them a spam score and report. This will be reflected under `spam_score` and `spam_report` in your Parse Webhook post. The user can then determine how this score is interpreted and the severity. **Send Raw** - Select this option if you would prefer to receive the full MIME message. ## Using the API If you're interested in how to use the Inbound Parse Webhook, please check out our [Inbound Parse Webhook API](https://sendgrid.api-docs.io/v3.0/settings-inbound-parse/). ================================================ FILE: content/docs/ui/account-and-settings/ip-access-management.md ================================================ --- seo: title: IP Access Management description: Control which IPs have access to your SendGrid account. keywords: mail settings, access management, IP allow listing, security title: IP Access Management weight: 0 group: ip-management layout: page navigation: show: true --- <iframe src="https://player.vimeo.com/video/298041979" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## What is IP access management? [IP Access Management](https://app.sendgrid.com/settings/access) is a security feature that allows you to control who can access your SendGrid account based on their [IP address]({{root_url}}/glossary/ip-address/). After you allow an IP address, you can only access the SendGrid UI, API, and SMTP relay if you are connecting from an allowed IP address. Any access attempts from other IPs will be blocked. This is a powerful security tool that you can use to help prevent malicious activity on your account. <call-out> There is no limit on how many IP addresses you can allow. </call-out> <call-out type="warning"> It is possible to remove your own IP address from your list of allowed addresses, thus blocking your own access to your account. While we are able to restore your access, we do require thorough proof of your identify and ownership of your account. We take the security of your account very seriously, and wish to prevent any "bad actors" from maliciously gaining access to your account. Your current IP is clearly displayed to help prevent you from accidentally removing it from the allowed addresses. </call-out> <call-out type="warning"> If you do not access SendGrid via a static IP address (for example, via VPN or from a business internet service), setting up IP Access Management may result in being locked out of your SendGrid account. If you do discover that you have locked yourself out of your account, please contact [SendGrid Support](https://support.sendgrid.com/hc/en-us/requests/new#ipam-lockout). </call-out> ## Allowing an IP Address There are several different ways to allow an IP address. If you navigate to the IP Access Management page under Settings, you will see a list of any currently allowed IP addresses and a list of IPs that recently attempted to access your account. ![]({{root_url}}/images/ip_access_management.png) ### Recent Access Attempts Under Recently Accessed 20 IPs, you will see a list of recent IPs that attempted to connect to your account, regardless of whether or not they are allowed addresses. You will also see some additional information about those IPs, such as the date of the first and most recent access attempt, the physical location of the IP, and the method by which they attempted to access your account. You can allow one of these IPs by clicking the gear icon in the row of the IP you would like to allow, then clicking **Add To Allowed List** . ![]({{root_url}}/img/add_ip_from_recent_access_attempts.png) ### Adding IP Addresses Manually To manually allow one or more IP addresses, click **+ Add IP Addresses**. ![]({{root_url}}/images/add_ip_address_button.png) You can add recently accessed IPs by clicking **Add to Form Below** next to the IP you wish to save, or you can enter a single IP address or range of IP Addresses in the field at the bottom of the modal and then click **Save**. ![]({{root_url}}/images/ip_access_management_add_ip.png) It is possible for advanced users to use CIDR notation to allow a range of IP addresses. To do so, simply enter your routing prefix followed by a `/` and then the number of bits in your routing mask. For example: `192.168.100.14/24`. <call-out type="warning"> Explaining CIDR notation is beyond the scope of this article, and we only recommend that advanced users use this notation when allowing IPs. If you are unfamiliar with CIDR notation, we recommend that you enter each IP individually when allowing a range of IPs. </call-out> To enter a range of IP addresses using a “wildcard”, simply add an asterisk to the end of the IP. For example, `25.203.44.*` would include all IPs that begin with `25.203.44`. After entering the IP addresses you would like to allow, click Save. <call-out> If you remove every IP address from your list of allowed addresses, you will again be able to log in to your account from any IP address. </call-out> For additional information about using IP Access Management through our API, see our [API Reference](https://sendgrid.api-docs.io/v3.0/ip-access-management). ================================================ FILE: content/docs/ui/account-and-settings/ip-pools.md ================================================ --- seo: title: IP Pools description: Using IP Pools to manage your sender reputation keywords: IP, IP address, deliverability title: IP Pools weight: 0 group: ip-management layout: page navigation: show: true --- IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together in order to have more control over your deliverability, and as a result, your sender reputation. For example, you might have separate pools for both transactional and marketing email. <call-out> Dedicated IP addresses are available with Pro and Premier Email API accounts as well as Advanced Marketing Campaigns accounts. Click [here](https://sendgrid.com/pricing/)for more information. </call-out> ## Create an IP Pool **Before you get started** In order to create an IP pool, your dedicated IPs must have [reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) set up. You also need to check to see if the IP is active before setting up an IP Pool. *To activate an IP in your account*: 1. Log into your SendGrid account. 1. Navigate to **Settings** and then select **IP Addresses**. 1. Find the ip address you want to activate and then click **Edit**. 1. Check "Allow my account to send mail using this IP address" 1. Then click **Save**. *To create an IP Pool:* 1. Navigate to **Settings** and then click **IP Addresses**. 1. Select **IP Pools**. 1. Click **Create an IP Pool**. 1. Enter an *IP Pool Name* and select the IP addresses you want to add to the pool. 1. Click **Create**. <call-out> For information on creating and managing IP pools using the API, see our [documentation](https://sendgrid.api-docs.io/v3.0/ip-pools). </call-out> ## Edit an IP Pool *To edit an IP Pool:* 1. Navigate to **Settings** and then click **IP Addresses**. 1. Select **IP Pools**. 1. Find the IP Pool you wish to delete and select the action menu. 1. Click **Edit**. 1. From here, you can edit the name of the IP pool as well as select or deselect IP addresses associated with the pool. 1. When you have finished making all changes to the IP pool, click **Save**. ## Delete an IP Pool *To delete an IP Pool:* 1. Navigate to **Settings** and then click **IP Addresses**. 1. Select **IP Pools**. 1. Find the IP Pool you wish to delete and select the action menu. 1. Click **Delete**. 1. A modal appears asking if you are sure you want to delete the selected IP Pool. Confirm, and then click **Delete**. <call-out> If you would like to create and manage IP Pools using the API, see our [API Reference](https://sendgrid.api-docs.io/v3.0/ip-pools/create-an-ip-pool). </call-out> ## Additional Resources - [Dedicated IP addresses]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/) - [Warming up a dedicated IP]({{root_url}}/ui/sending-email/warming-up-an-ip-address/) - [IP Access Management]({{root_url}}/ui/account-and-settings/ip-access-management/) ================================================ FILE: content/docs/ui/account-and-settings/log-in-issues.md ================================================ --- seo: title: Troubleshooting account login issues description: Troubleshooting account login issues keywords: password, log, can't, authentication, username, reset, get, failed, user, invalid, account, deactivated, banned, in, terminated, bad username/password, name, won't, 535, 535 Authentication failed: Bad username / password, login, access, denied title: Troubleshooting account login issues weight: 0 group: account-management layout: page zendesk_id: 204192663 navigation: show: true --- There are a number of reasons why you may find yourself unable to log into your account. This article aims to explain these reasons as well as offer steps to get you back in action. ## Invalid username and/or password Usually this is as simple a retyping one or both fields (you're only human after all), but could be something else. Check out to following for some possible reasons. ## You haven't confirmed your email address Did you just sign up? If you don't verify your email address we never create your account, so be sure to check your registration email and click on the link we send! ## Check with other users You may have at some point shared your credentials with someone else/another department, check with them to make sure they haven't changed anything. Also consider implementing [Teammates]({{root_url}}/ui/account-and-settings/teammates/) to set different levels of permissions. ## Reset your password Sometimes passwords just vanish from memory, it happens to the best of us. Use the reset password link from the login screen to start the reset process via email. **_Be careful_** though, changing your password can break existing API and SMTP integrations you have in production, so be sure to update your password wherever else it is used after resetting. ## Usernames can be anything We don't have a strict username syntax policy, so it may be something you wouldn't normally use. Read more about finding and recovering your username [here]({{root_url}}/ui/account-and-settings/resetting-your-username-and-password/). ## Bad username/password Usually received via the API, this error means we don't recognize one or both of the **api\_user** and **api\_key** parameters that you've passed in your call. ## Billing terminated On the last week of each month, we terminate accounts with outstanding unpaid balances from the previous month's bill run. _Terminated accounts cannot be accessed nor send mail._ We will send out several warning emails in the course of a month if an account fails to pay on time, so you should have ample warning before Termination. However, if you believe your account has been terminated due to non-payment, please get in touch with [Support](https://support.sendgrid.com) and we can help get you out of the red and sending again. ## Account banned When an account is banned, it is permanently canceled. Access to the account is blocked and no further requests to our system will be accepted. A banned account is not allowed back on SendGrid in the future. If the account had dedicated IPs they will be removed. Related sub-users will also be banned. We don't make a habit of letting banned accounts back on, but if you would like to discuss it, _please respond to the email you received regarding the ban._ <call-out type="alert"> Support cannot assist in reactivation of banned accounts. </call-out> ================================================ FILE: content/docs/ui/account-and-settings/mail.md ================================================ --- seo: title: Mail Settings description: Manage your SendGrid mail settings keywords: sendgrid mail settings, email settings, sending settings title: Mail Settings weight: 0 group: account-management layout: page navigation: show: true --- Mail Settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrid’s [Web API]({{root_url}}/api-reference/) or [SMTP Relay]({{root_url}}/glossary/smtp-relay/). ## Address Allow List The Address Allow List setting allows a specified email address or domain for which mail should never be suppressed. For example, you own the domain “example.com,” and one or more of your recipients use email@example.com addresses, by placing example.com in the Address Allow List setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions. **Settings** - Status - On or Off - Emails/Domains - Either a single email or the domain, for which all emails belonging to this domain will be allowed. ## BCC <call-out type="warning"> Due to low usage, this setting has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> Automatically sends a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules. <call-out type="warning"> With this setting turned on, you will be charged an extra email for every email you send. </call-out> **Settings** - Status - On or Off - Email to BCC To - Click **Edit** to add an email address to which all emails you send will be BCCd. ## Bounce Purge Allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists. **Settings** - Status - On or Off - Soft Bounces - The number of days soft bounces will be kept in your soft bounces suppression lists. Any soft bounces older than this value will be purged (Min: 1, Max: 3650). - Hard Bounces - The number of days hard bounces will be kept in your hard bounces suppression lists. Any hard bounces older than this value will be purged (Min: 1, Max: 3650). Please Note: Entering values for both Soft and Hard Bounces is not necessary. Only enter a value for the types of bounces you would like purged; empty values will be ignored. ## Event Notification The Event Notification setting controls webhook notifications for events, such as bounces, clicks, opens, and more. This setting allows these events to be POSTed to a URL of your choosing. Please see our technical [Event Webhook API docs](https://sendgrid.api-docs.io/v3.0/webhooks) for more information about Event Webhook. **Settings** - Status - On or Off - HTTP Post URL - The URL you would like us to send all event notifications. - Select Actions - Check the boxes for which events you would like sent to your webhook endpoint. ### Other features **Test Your Integration** - Once you have a valid URL entered, this button will be made active. When you click the button, we will attempt to send a test post to your webhook code. If we see any issues, we will notify you in a warning message at the top of your browser. ## Footer The Footer setting will insert a custom footer at the bottom of the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails. <call-out> This feature is not available in our Marketing Campaign Editor. </call-out> **Settings** - Status - On or Off - Footer - HTML Body: Click “Edit” to add your custom footer content. ## Forward Bounce Activating this setting allows you to specify an email address to which bounce reports are forwarded. Insert the email address to which you would like to receive these bounce reports. <call-out> You will not be charged an email when these reports are forwarded to you. </call-out> **Settings** - Status - On or Off - Email - Click “Edit” to add an email address where you’d like bounce emails to be forwarded. ## Forward Spam Activating this setting allows you to specify an email address to which spam reports are forwarded. Insert the email address to which you would like to receive spam reports. <call-out> You will not be charged an email when these reports are forwarded to you. </call-out> ### Forwarding abuse The email address specified in the Forward Spam mail setting may also be used to receive emails sent to abuse@ and postmaster@ role addresses if you have [authenticated your domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). For example, if you create a valid authenticated domain with a custom return path of `sub` and a root domain `example` _and_ have turned on Forward Spam, any emails sent to abuse@sub.example.com or postmaster@sub.example.com will be forwarded to the email address you entered in the Forward Spam mail setting. **Settings** - Status - On or Off - Email - Click “Edit” to add an email address where you’d like spam to be forwarded. ## Legacy Email Template <call-out type="warning"> This setting refers to our original Email Templates. We now support more full featured [transactional templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/), with support for multiple templates, versioning, and more. </call-out> This setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages. Use the embedded, full-featured HTML editor to create a template that your emails will be wrapped in. Be sure to include a tag to place the content of your email. **Settings** - Status - On or Off - Template - Click **Edit** to define your HTML template within the WYSIWYG editor. ## Plain Content <call-out type="warning"> Due to low usage, this setting has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> The Plain Content setting will automatically convert any plain text emails that you send to HTML before sending (if disabled). Turn _on_ if you don't want to convert your plain text email to HTML. <call-out> Large plain text files are sometimes unable to be converted to HTML. Instead, SendGrid will send only the plain text version. If HTML versions are essential, it is best practice to include the HTML portion of the email within your email requests. When SendGrid is unable to convert from plaintext to HTML, an alert is sent to the From address. </call-out> **Settings** - Status - On or Off ## Spam Checker <call-out type="warning"> Due to low usage, this setting has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> The Spam Checker setting, is useful when your web application allows your end users to create content that is then emailed through your SendGrid account. Since emailing user generated content is hard to monitor and can often be abused by spammers, the Spam Checker filter notifies you when emails are detected that exceed a predefined spam threshold. <call-out type="warning"> The default threshold is 5.0 and can range between 1 and 10. The lower the number, the more strict the filtering. For example, a value of 2 will drop all but the most flawless emails, whereas 9 will only drop the spammiest of spam emails. </call-out> We use [SpamAssassin](http://spamassassin.apache.org/full/3.4.x/doc/Mail_SpamAssassin_Conf.html#scoring_options) to process the spam checks for this filter. The default threshold is 5.0, but you can set this to any value between 1 and 10. You must provide a URL, so we will post the message to that URL. If a message is flagged as spam using this filter, it will automatically be dropped by our system and will not be delivered to the recipient. **Settings** - Status - On or Off - Spam Threshold - Click **Edit** to change the threshold from 1-10 (**see the message above**) - URL To Post Spam Messages To - Click **Edit** to provide an Inbound Parse URL to send spam messages to, so you can inspect them. If you don't have an Inbound Parse URL, check out [Setting Up The Inbound Parse Webhook]({{root_url}}/for-developers/parsing-email/inbound-email/). ================================================ FILE: content/docs/ui/account-and-settings/notifications.md ================================================ --- layout: page weight: 90 group: account-management title: Notifications navigation: show: true seo: title: Notifications override: true description: --- If you would like to have notifications sent to an email other than your parent account address, you can opt in to receive email notifications from SendGrid about your account's Marketing Campaigns activity. *To add an email address to new Marketing Campaigns:* 1. Navigate to new Marketing Campaigns and then click **Notifications**. 1. Click **Add New Email**. 1. Enter the name of the person or account you are setting up the notification for. 1. Enter the email address of the person or account you are setting up the notification for. 1. Click **Save**. *To add an email address to legacy Marketing Campaigns:* 1. Navigate to legacy Marketing Campaigns and then click **Notifications**. 1. Click **Add New Email**. 1. Enter the name of the person or account you are setting up the notification for. 1. Enter the email address of the person or account you are setting up the notification for. 1. Click **Save**. <call-out> Email notifications about CSV upload summaries, sender verifications, A/B test winner notifications, and list/segment exports can be sent to up to 10 different email addresses. </call-out> ## Additional Resources - [Contacts]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/) ================================================ FILE: content/docs/ui/account-and-settings/partners.md ================================================ --- seo: title: Partner Settings description: Manage your SendGrid partner settings keywords: sendgrid partner settings, partner settings, 3rd party settings title: Partners weight: 0 group: account-management layout: page navigation: show: true --- Partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. ## SendGrid For New Relic Access your email statistics via the [New Relic Dashboard](http://newrelic.com/). In less than 5 minutes your statistics should be sent to your New Relic Dashboard. We send statistics to New Relic every 5 minutes for users with the setting enabled. For more information, please see our [Setting up SendGrid for New Relic page]({{root_url}}/ui/analytics-and-reporting/tracking-stats-using-new-relic/). **Settings** * Status - On or Off * New Relic License Key - The license key provided with your New Relic account. ================================================ FILE: content/docs/ui/account-and-settings/password-reset-appdirect.md ================================================ --- seo: title: How to change password when integrated via AppDirect description: How to change password when integrated via AppDirect keywords: password, appdirect title: How to change password when integrated via AppDirect weight: 0 group: account-management layout: page zendesk_id: 205005058 navigation: show: true --- If your SendGrid account is integrated via AppDirect the process for changing your password is slightly different . Rather than updating them via the **Account Settings** you can update your credentials by going to **Manage Apps** > **SendGrid** > **Settings** via the AppDirect UI. ================================================ FILE: content/docs/ui/account-and-settings/password-reset-azure.md ================================================ --- seo: title: How to change the password for your SendGrid add-on via Azure description: How to change the password for your SendGrid add-on via Azure keywords: password, azure, microsoft, change title: How to change the password for your SendGrid add-on via Azure weight: 0 group: account-management layout: page zendesk_id: 205027298 navigation: show: true --- Please note that in order to maintain seamless email flow, it is important to also update any custom code, web pages or servers that use this account with your new passwords. If you are uncertain about these additional steps, consult the email administrator who created the account. You should also make sure you are logged out of SendGrid.com before making any changes to your password via the Azure portal. 1. Log into your Azure subscription at portal.azure.com and find your SendGrid deployment: ![]({{root_url}}/images/AzurePW1.png) 1. Select **Change Password**, then enter and re-confirm your new password. Remember to save your new password in order for it to take effect. Your new password must be a minimum of 8 alpha-numeric characters. ![]({{root_url}}/images/AzurePW2.png) 1. If you do not know your current password then click “Reset Password” instead. ![]({{root_url}}/images/AzurePW3.png) ================================================ FILE: content/docs/ui/account-and-settings/password-reset-email.md ================================================ --- seo: title: I didn't receive the password reset email description: Initiate a password reset and haven't received it? keywords: password, reset, email, account, bad username/password, login title: I didn't receive the password reset email weight: 0 group: account-management layout: page navigation: show: true --- There are a few things to take into account when requesting a password reset: * Make sure you are entering your username and not your email address in the password reset screen. * Ensure that you are expecting the email at the correct address. The password reset will be sent to email you have in your SendGrid account settings for the username you enter. * It is also possible that you cannot login because our billing team has terminated your account due to non-payment. In this case you would have received several emails detailing the reason behind the termination. These emails are also going to the email you have in your SendGrid account settings. * The reset email may be in your SPAM or Junk folder. If you do find it there, be sure to mark it as "not spam". **For security reasons, SendGrid support agents cannot change account passwords.** ================================================ FILE: content/docs/ui/account-and-settings/password-reset-ibm-cloud-marketplace.md ================================================ --- seo: title: How to change the password for your SendGrid add-on via the IBM Cloud Marketplace description: How to change the password for your SendGrid add-on via the IBM Cloud Marketplace keywords: password, icloud, ibm, marketplace title: How to change the password for your SendGrid add-on via the IBM Cloud Marketplace weight: 0 group: account-management layout: page zendesk_id: 205306378 navigation: show: true --- As an IBM Cloud Marketplace user you can change the password for your SendGrid account by following a few simple steps. From the Cloud Marketplace go to **Services > SendGrid > Settings.** From there you should see the following: ![]({{root_url}}/images/ibmcld.png) After entering the new password and confirming it, click **Save**. ================================================ FILE: content/docs/ui/account-and-settings/password-reset-openshift.md ================================================ --- seo: title: How to change the password for your SendGrid add-on via OpenShift description: How to change the password for your SendGrid add-on via OpenShift keywords: title: How to change the password for your SendGrid add-on via OpenShift weight: 0 group: account-management layout: page zendesk_id: 205102558 navigation: show: true --- After a user logs in they will arrive at Purchased Products where it will list their products. From here they will need to find the SendGrid app. Below is a step by step screenshot of how to locate the password section so that they can update their credentials. From the Purchased Products section select **SendGrid** on the left hand side of the application block. ![]({{root_url}}/images/openshiftshot1.png) After selecting the link you’ll be in the Manage Product page specific to SendGrid: ![]({{root_url}}/images/openshiftedit3.png) From here you can select the **settings** tab which will display the below information. From here, you can reset your password for SendGrid. Please keep in mind this is for the parent access and not subuser access that may have been added via the SendGrid UI. ================================================ FILE: content/docs/ui/account-and-settings/password-reset-softlayer.md ================================================ --- seo: title: How to change the password for your SendGrid account via SoftLayer description: How to change the password for your SendGrid account via SoftLayer keywords: password, softlayer title: How to change the password for your SendGrid account via SoftLayer weight: 0 group: account-management layout: page zendesk_id: 205325008 navigation: show: true --- If you have a SendGrid account via Softlayer you can use the following steps to change your account password. From the Softlayer UI navigate to the **Services** drop down and select **Mail Delivery**. From there click **Actions** and select **Update contact information**. Enter a new password, re-enter to confirm it and you're done! ================================================ FILE: content/docs/ui/account-and-settings/pci-compliant.md ================================================ --- seo: title: Is SendGrid PCI compliant? description: Is SendGrid PCI compliant? keywords: credit, card, pci, dss, compliant title: Is SendGrid PCI compliant? weight: 0 group: account-management layout: page zendesk_id: 205104628 navigation: show: true --- **Yes!** We do not store your credit card information anywhere in our systems. We can provide a PCI-DSS certificate upon request. ================================================ FILE: content/docs/ui/account-and-settings/reading-your-invoice.md ================================================ --- seo: title: Reading your invoice description: Reading your invoice keywords: invoice, bill, receipt, refund, line, item, marketing, campaigns, charge, contacts, usage, overage title: Reading your invoice weight: 0 group: billing layout: page navigation: show: true --- Your Twilio SendGrid invoice contains a lot of information which may be difficult to understand. To see your invoice, check your email or visit the Plan & Billing tab on your [Account details](https://app.sendgrid.com/account/billing) page. Here's information on how to read your invoice: ![A screenshot of an example invoice]({{root_url}}/img/invoice-legend.png) ## 1. Physical Address **The physical address of your business.** This address is the same address you entered when you first signed up. If you would like to update the address as it appears on your invoices, edit your company info on the [Account details](https://app.sendgrid.com/account/billing) page. If you need to change the address on an existing invoice, please send an email to [billing@sendgrid.com](mailto:billing@sendgrid.com). ## 2. Billing Email **The email address where you receive Twilio SendGrid statements**. By default, this is the primary email address on file in your account. Need to send invoices to multiple addresses? Consider creating a role address on your side that includes all of the billing stakeholders in your organization, or send an email to [billing@sendgrid.com](mailto:billing@sendgrid.com). ## 3. Charge Summary The Charge Summary section breaks down your invoice total into individual charges. Some charges covered by this invoice are retroactive, meaning you are paying for usage in the previous month, while others are proactive, meaning you are paying for services for the upcoming month. This information is broken down in the **Service Period** column. ### API Plan ![Charge summary section]({{root_url}}/img/invoice-plan.png) This is the **plan you subscribe to**. In this case, the user is on an API Pro 100K plan and will pay $89.95 to use it for the month of February. ### Marketing Campaigns Plan ![Charge summary section]({{root_url}}/img/invoice-marketing-plan.png) This is the **Marketing Campaigns plan you subscribe to**. In this case, the user is on a Marketing Campaigns Basic 5K plan, and will pay $15.65 to use it for the month of February. ### IP Address ![Additional IP address section]({{root_url}}/img/invoice-IP-address.png) This charge indicates that you have an **additional Dedicated IP Address** allocated to your account. If you have more than one IP address the total cost will be listed on this line. IP addresses cost $30.00/mo each and are available on Pro API and Advanced Marketing Campaigns plans and above. For more information on Twilio SendGrid Plans, visit our [pricing page](https://sendgrid.com/pricing). ### Contact List Storage ![Contact storage section]({{root_url}}/img/invoice-contact-1.png) This item is the charge for the highest number of **contacts stored in Marketing Campaigns during the previous month**. Refer to "Contact List Usage" in the Usage Summary section below for more information on how this charge is calculated. ### Email Activity History ![Email activity section]({{root_url}}/img/invoice-ease.png) This charge is for access to the **Email Activity Feed API** as well as **30 days worth of Email Activity History** in the app. These 2 features are sold as a package and cannot be added individually. The price for access to this feature varies per plan. For more information on pricing for Email Activity History, visit our [pricing page](https://sendgrid.com/pricing). ### Tax ![Tax summary section]({{root_url}}/img/invoice-tax.png) If you are in [a jurisdiction where Twilio SendGrid is required to charge sales tax]({{root_url}}/ui/account-and-settings/taxes-and-tax-exempt/), your **tax charges** will appear here. ## 4. Usage Summary The Usage Summary section outlines usage-based charges on your account **during the previous month**. ### Plan Overage ![Overage charges section]({{root_url}}/img/invoice-overage.png) This item is a calculation of **any emails sent beyond the monthly limit** of your package **during the previous month**. In this example, the Pro 100K plan allows for 100,00 emails to be sent per month. We see that in the previous month, 160,000 emails were sent for a total of 60,000 emails over the limit. The overage rate for the Pro 100K plan is $0.001 per extra email, which works out to a $60.00 overage charge (60,000 x .001 = 60). ### Contact List Usage ![Highest number of stored Marketing Campaigns Contacts in the previous month.]({{root_url}}/img/invoice-contact-storage.png) This item refers to the highest number of **stored Marketing Campaigns Contacts in the previous month**. For more detailed breakdown on how Contact Storage billing works in Marketing Campaigns, [click here]({{root_url}}/ui/account-and-settings/billing/). In this example, the number under the "Used" column refers to the number of "blocks" of 10,000 contacts that were stored in the previous month. We see that the highest number of blocks stored in that month was 1, or 10,000 contacts. The charge for contact storage is **$10.00/mo for every 10,000 contacts (1 block)**, so this example works out to a $10.00 usage charge for contacts stored in the previous month. ## 5. Transaction and Payment Summary ![Transaction and payment summary]({{root_url}}/img/invoice-payment-summary.png) The Transaction Summary shows the total charges for the month, and the Payment Summary shows the payment type and last 4 digits of the card that was charged. To change your payment method, go to [Account details](https://app.sendgrid.com/account/billing). **These sections always reflect the plan you currently have, not necessarily "Pro 100K", which is shown for the purposes of demonstration**. ## Additional Resources - [SendGrid Pricing](https://sendgrid.com/pricing) - [Billing]({{root_url}}/ui/account-and-settings/billing/) - [Sales Tax and Tax Exempt Status]({{root_url}}/ui/account-and-settings/taxes-and-tax-exempt/) ================================================ FILE: content/docs/ui/account-and-settings/resetting-your-username-and-password.md ================================================ --- layout: page weight: 0 title: Resetting your username and password group: account-management navigation: show: true seo: title: Resetting your username and password override: true description: Steps for resetting your username and password using the SendGrid UI --- ## Changing your password If you already know your password, you can change your SendGrid password by editing your [Account Details](https://app.sendgrid.com/settings/account) in the UI. If you've forgotten your password, you can reset it on the [Reset password page](https://app.sendgrid.com/forgot_password). <call-out type="warning"> When you change your account password, your SMTP and API access will change as well. Make sure you update your account information on all systems and software. </call-out> ### Changing your password through the SendGrid UI *To change your password through the SendGrid UI:* 1. From the homepage, select the drop-down in the top left corner and then select **Account Details** or navigate to **Settings** and then click **Account Details**. 1. Locate the *Username* and *Password* section and click **Edit**. 1. Enter your current password and a new password in the fields and then click **Save**. ### Resetting your password If for some reason you cannot remember your password and cannot log in, you can still change your password. *To reset your password using the Forgot Password link:* 1. Navigate to the [SendGrid login page](https://sendgrid.com/login). 1. Click **[Forgot Password](https://sendgrid.com/user/forgotPassword)**. 1. Enter your SendGrid username. We will send you an email with account reactivation steps - follow these to access your account again. If you don't receive the email, you may not be entering the correct username. ## Changing your username *To change your username:* 1. From the homepage, select the drop-down in the top left corner and then select **Account Details** or navigate to **Settings** and then click **Account Details**. 1. Click **Edit**. 1. Enter a new username and then click **Save**. <call-out type="warning"> When you change your account username, your SMTP and API access will change as well. Make sure you update your account information on all systems and software. </call-out> ### Resetting your username In the event that you forget your username, you can reset it by filling out [this form](https://support.sendgrid.com/hc/en-us/requests/new#forgot-username). ================================================ FILE: content/docs/ui/account-and-settings/retired-mail-settings.md ================================================ --- layout: page weight: 70 title: Underused Mail Setting Retirement group: account-management navigation: show: false seo: title: Underused Mail Setting Retirement keywords: override: description: This page explains the changes to Twilio SendGrid mail settings coming in Q1 2020 --- As we continuously modernize our email delivery infrastructure, we have sunset some sparsely used features in order to improve efficiency. <table> <tr> <th>Mail Setting</th> <th>Recommended Action</th> </tr> <tr> <td><span style="font-weight:bold">Plain Content</span> is an option within SendGrid Mail Settings that disables the automatic conversion of plain text emails to HTML.</td> <td>If you would like to maintain open and click tracking, you must send HTML. Otherwise, you can continue sending plain text emails without open and click tracking.</td> </tr> <tr> <td><span style="font-weight:bold"><a href="http://en.gravatar.com/">Gravatar</a></span> third party integration.</td> <td>Due to low adoption among customers we decided to sunset this feature.</td> </tr> <tr> <td><span style="font-weight:bold">Sections</span> is a form of mail merge where sections of an email content can be customized by recipient.</td> <td>We recommend using Twilio SendGrid <a href="https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/">transactional templates</a> with handlebars syntax through our v3 API.</td> </tr> <tr> <td><span style="font-weight:bold">BCC </span>automatically BCCs an email address for every email sent.</td> <td>We recommend identifying bcc as a <a href="https://sendgrid.com/docs/for-developers/sending-email/personalizations/#sending-a-single-email-to-a-single-recipient-with-a-cc-and-a-bcc">personalization</a> in each API call.</td> </tr> <tr> <td><span style="font-weight:bold">Spam Checker </span>is an option within SendGrid Mail Settings that checks outbound messages for spam content.</td> <td>We recommend using <a href="https://sendgrid.com/docs/ui/sending-email/email-testing/">Email Testing</a> to maximize your deliverability.</td> </tr> <tr> <td><span style="font-weight:bold">Drop feature</span> is a test feature that goes through the processing of mail, but just drops it without delivering in the end.</td> <td>We have a <a href="https://sendgrid.com/docs/for-developers/sending-email/sandbox-mode/">Sandbox Mode</a> feature which allows you to send a test email to ensure that your request body is formatted correctly without delivering the email to any of your recipients.</td> h </tr> <tr> <td><span style="font-weight:bold">Sendwithus</span> third party Integration</td> <td>We recommend using Twilio SendGrid Marketing Campaigns.</td> </tr> <td><span style="font-weight:bold">DomainKey</span> is an old feature for signing emails which has been deprecated by email industry. </td> <td>Users should utilize <a href="https://sendgrid.com/docs/glossary/dkim/">DKIM</a> which is the new standard for signing emails. </td> </table> ================================================ FILE: content/docs/ui/account-and-settings/reverse-dns.md ================================================ --- layout: page weight: 0 title: How to set up reverse DNS - beta group: sender-authentication navigation: show: true seo: title: How to set up reverse DNS override: true description: Set up reverse DNS to improve your deliverability and security of your emails. keywords: reverse DNS, rDNS, sender verification --- <!-- OUTDATED REVERSE DNS VIDEO --!> <!-- <iframe src="https://player.vimeo.com/video/265831363" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> --> You can only set up reverse DNS if you have a [dedicated IP]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/). </call-out> ## What is reverse DNS? Setting up reverse DNS on an IP address allows mailbox providers to verify the sender when they do a reverse DNS lookup upon receipt of the emails you send. When you update your DNS provider with a DNS record provided by SendGrid, and then send mail over your IP, the recipient's email service provider performs a reverse DNS lookup (rDNS) using an A Record (address record). An A Record maps your domain to your IP address. When a mailbox provider looks up your A Record, they see your SendGrid IP address. When they look at your IP address, they see the rDNS that matches your A Record. This circular checking proves your SendGrid IP association with your domain and your domain association with your SendGrid IP. ## Key terminology ### IP Address An Internet Protocol (IP) Address is a unique numerical address that defines an internet location. These addresses have 4 sets of numbers separated by periods. For example, 127.0.0.1 is an IP address. At SendGrid, you can be on a shared IP address, or you can have a dedicated IP address. We recommend a dedicated IP address for people sending high volumes of email or for people who want control over the quality of mail sent on the same IP as theirs. The aggregate performance of all the senders who use the IP determines its reputation. ### DNS DNS stands for Domain Name System. This is a naming system for domains on the internet. When SendGrid refers to your DNS, we are talking about your domain name that you want to send emails from. When we talk about your DNS provider, we are talking about the service that hosts your domain name. For example, GoDaddy, Rackspace, or Cloudflare. For more information about DNS, see our [DNS glossary page]({{root_url}}/glossary/dns/). ### A Record The A Record (address record) links your dedicated IP address to your chosen domain. It does this by mapping your domain to your IP address through records that you export from SendGrid and upload into your DNS host. If your domain+subdomain is `marketing.example.com`, and your dedicated IP address is `101.10.10.101`, setting up the SendGrid A Record links your domain with your dedicated IP address - so anything sent over your domain associates with your dedicated IP, and anything sent over your dedicated IP associates with your domain. ### Subdomain A subdomain is a prefix appended to your domain and used for tracking and reporting on your validated IP. Your subdomain cannot be the same as your other IP subdomains. It's a good idea to check your current DNS settings with your DNS provider to confirm that the subdomain you would like to use is available. Try to pick a name for this subdomain that represents the type of email you will send using it. For example, "marketing" or "billing". Do not use underscores in your subdomain. We create your DNS records based on the subdomain, and DNS providers do not accept DNS records that contain underscores. <call-out type="warning"> Your sending reputation is determined by the reputation of your root, or top-level, domain. This is true even if you have several different subdomains with the same authenticate domain. For example, both `billing.example.com` and `marketing.example.com` will share the reputation of `example.com`. </call-out> ### Before you begin To set up reverse DNS, you must submit the DNS records provided by SendGrid to your DNS or hosting provider (for example, GoDaddy, Hover, CloudFlare, etc.). First, figure out who your hosting provider is and if you have access. If you don't have access to your DNS or hosting provider, you should figure out who in your company has this access before you begin setting up reverse DNS. *To set up and verify reverse DNS:* 1. In the SendGrid UI, select [Settings > Sender Authentication](https://app.sendgrid.com/settings/sender_auth). 2. In the reverse DNS section, click **Get Started**. 3. Next, add information about your DNS host and select the IP address you would like to use to set up reverse DNS. Optionally, you may wish to filter your IP addresses by the subuser they are assigned to. 4. Select or enter a domain you want to associate with the IP address. Make sure that you only enter the name of your root domain. Do not include `www` or `http://www` in this field. Your domain needs to match the domain of your FROM address on the emails you are sending out. For example, if I am setting up the domain `example.sendgrid.com`, I would set my domain to be `sendgrid.com`. An individual IP address can only have one reverse DNS set up. Optionally, you may wish to access advanced settings, where you can add a custom subdomain. For more information about picking a subdomain, see [Subdomains](#subdomain). 5. Click **Next** to save and view verification information. 6. Next, you need to add all of the A Records on this screen to your DNS host. This process varies depending on your DNS host. For videos on how to add your A Records to some popular DNS service providers, check out these [videos]({{root_url}}/ui/account-and-settings/dns-providers/). If you don't have access to modify your companies DNS records, you can also email a request to a co-worker. This email includes a direct link to the A records. This link does expire. The recipient doesn't need login access to your SendGrid account. <call-out> If you plan to send from multiple domains, you should set up reverse DNS for at least one IP address per domain. </call-out> It can take up to 48 hours for the records to verify after you upload them to your DNS host, so you will likely have to come back later to verify. ### Verifying Once you add the A Records to your DNS host, return to the IP address detail page, or locate the IP on the [Reverse DNS listing page](https://app.sendgrid.com/settings/sender_auth/reverse_dns). Once you have located the correct IP address, click **Verify**. <call-out> If you click verify, and only half of your A name records verify, this usually means that you need to wait a bit longer. It's also possible that you entered one of your records in incorrectly. For other troubleshooting information, see [Sender authentication troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/). </call-out> Now your dedicated sending IP is associated with your domain. You only need to update your reverse DNS if you add additional dedicated IPs to your account. ## Reverse DNS for a subuser Only a parent account can set up reverse DNS for an IP address. For a subuser account to have an IP that has reverse DNS set up, the parent account needs to buy the IP, set up reverse DNS and then [assign the IP to the subuser]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/#assigning-a-dedicated-ip-address-to-a-subuser). ## What do I do if I have more than 10 IPs? There is a character limit in SPF (sender policy framework) records that means that if you have more than 10 IP addresses, they will not fit in the record. When this is true, we will provide you with the generic SendGrid SPF record which includes all IPs at SendGrid, not just yours. If you would like to secure your SPF record only to include your IPs, you can chain multiple SPF records together manually. For more information see Open SPF’s [website](http://www.openspf.org/). ## Additional resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [Troubleshooting]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) ================================================ FILE: content/docs/ui/account-and-settings/safely-test-your-sending-speed.md ================================================ --- seo: title: Safely Test Your Sending Speed description: Safely Test Your Sending Speed keywords: throughput, through, put, speed, requests, sending title: Safely Test Your Sending Speed group: account-management weight: 0 layout: page navigation: show: true --- Have you ever wanted to see how quickly you can send multiple messages through SendGrid, but you were concerned about how it would affect your reputation? Worry no more! We have configured a special domain for any users who are interested in testing out SendGrid's relay speeds at higher volumes without it negatively impacting your reputation. You can send your test messages to any address **@sink.sendgrid.net** while still using our standard integration practices. All messages to this domain are accepted for delivery and then immediately deleted. Sending to this domain will not contribute to the [IP warmup process]({{root_url}}/ui/sending-email/warming-up-an-ip-address/) if you have an account with a dedicated IP address. <call-out> Please be aware that all of the messages you send to this domain will still consume billable email credits for your account! </call-out> If you are looking to test your API integration, you can enable the `sandbox_mode` in the [`mail_settings` parameters of our Mail Send API]({{root_url}}/for-developers/sending-email/sandbox-mode/). **This will allow you to validate each parameter you include, and the structure of your JSON payload, all without actually sending a message.** <call-out> Please note, `sandbox_mode` is not available for other endpoints, only `mail_send`. </call-out> ================================================ FILE: content/docs/ui/account-and-settings/spf-dkim.md ================================================ --- seo: title: Internet Standards (SPF and DKIM) and Deliverability description: Internet Standards (SPF and DKIM) and Deliverability keywords: spf, dkim, trusted, sender verification, standards, 10, dns title: Internet Standards (SPF and DKIM) and Deliverability weight: 0 group: sender-authentication layout: page navigation: show: true --- For standards like [SPF]({{root_url}}/glossary/spf/) and [DKIM]({{root_url}}/glossary/dkim/) / DomainKeys, whether they improve deliverability or bypass filters is entirely at the discretion of the validating receivers. It is expected that messages from a sender with a good reputation would be subject to less scrutiny by the receiver's filters. In other words, omitting these standards usually doesn't hurt, but providing them can only help deliverability. Some other things to consider: - [DKIM](http://tools.ietf.org/html/rfc4871) is an internet standards track standard and deprecates [DomainKeys](http://tools.ietf.org/html/rfc4870) - If you turn off DomainKeys, we will still sign the email with DKIM which is not affected by the [on behalf of issue]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/), and is designed for the type of third-party signing we do. - An SPF record is invalid if it requires [more than 10 DNS lookups]({{root_url}}/ui/account-and-settings/spf-records/) - An SPF record is invalid if you have more than one SPF record for a given domain. In this case, you will want to merge the additional SPF records into one SPF record. ## Additional resources - [DKIM Frequently Asked Questions](http://www.dkim.org/info/dkim-faq.html) - [SPF Records Explained]({{root_url}}/ui/account-and-settings/spf-records/) - [DKIM Records Explained]({{root_url}}/ui/account-and-settings/dkim-records/) - [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) ================================================ FILE: content/docs/ui/account-and-settings/spf-limitations.md ================================================ --- seo: title: SPF: Don't Exceed Ten DNS Lookups! description: SPF: Don't Exceed Ten DNS Lookups keywords: title: SPF: Don't Exceed Ten DNS Lookups! weight: 0 group: account-management layout: page navigation: show: true --- Many people may not realize it, but the Sender Policy Framework (SPF) specification has a limit on the number of DNS lookups (10) required to fully resolve an SPF record. One typically quickly exceeds this limit through the reckless use of the include modifier. Section 10.1, "Processing Limits" of the [SPF RFC](http://datatracker.ietf.org/doc/rfc4408/?include_text=1) specifies the following in regards to DNS lookups: > SPF implementations MUST limit the number of mechanisms and modifiers that do DNS lookups to at most 10 per SPF check, including any lookups caused by the use of the "include" mechanism or the "redirect" modifier. If this number is exceeded during a check, a PermError MUST be returned. The "include", "a", "mx", "ptr", and "exists" mechanisms as well as the "redirect" modifier do count against this limit. The "all", "ip4", and "ip6" mechanisms do not require DNS lookups and therefore do not count against this limit. The "exp" modifier does not count against this limit because the DNS lookup to fetch the explanation string occurs after the SPF record has been evaluated. This limit is in place to prevent SPF lookups from being a useful avenue for Denial of Service attacks. Is your SPF record validating? You can find out [here](http://www.kitterman.com/spf/validate.html). ================================================ FILE: content/docs/ui/account-and-settings/spf-records.md ================================================ --- seo: title: SPF Records Explained description: SPF Records Explained keywords: permission, spf, sender verification, include, spf1, spf2, return, path, ~all, -all, +all, sender, permitted, forgery, spoofing, spoof, fail, failed, validation, validate title: SPF Records Explained group: account-management weight: 0 layout: page navigation: show: true --- Sender Policy Framework (SPF) is an open standard aimed at preventing sender address forgery. This article describes how SPF is configured for use with SendGrid. ## SPF overview SPF attempts to prevent email sending abuse by ensuring that the IP address from which a message was sent is authorized to send mail on behalf of the domain in the email’s Envelope From or `return-path`. <call-out> For more information about From addresses and email, see our article on [email spoofing]({{root_url}}/glossary/spoofing/). </call-out> SPF is implemented by adding a [TXT record](https://en.wikipedia.org/wiki/TXT_record) to a domain’s [DNS]({{root_url}}/glossary/dns/) records. The TXT record specifies which IP addresses are allowed to send email for the domain. ## SPF mail flow To understand SPF, it may help to understand how email traffic is handled when SPF is added to the process. Imagine an email server receives a message and checks the message's `return-path`. The `return-path` is `sender@example.com`. To perform an SPF check, the following steps take place: 1. The receiving email server retrieves the SPF record from the DNS records for the `example.com` domain. 2. The receiving server then checks the SPF record for all the IP addresses that are approved to send email on behalf of the domain. 3. If the SPF check passes, the receiving server can be confident the message was sent from an approved sending server and will continue processing the message. 4. If the SPF check fails, the message is likely illegitimate and will be processed using the receiving server’s failure process. ![A diagram of the SPF traffic flow described in the steps above this image]({{root_url}}/img/spf_mail_flow.jpeg "SPF mail flow diagram") ## SPF and sender authentication ### SendGrid's automated security When you complete Domain Authentication, [automated security]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/#using-automated-security) is enabled by default. Automated security handles your SPF and [DKIM]({{root_url}}/glossary/dkim) records for you. Twilio SendGrid provides [CNAME records]({{root_url}}/glossary/cname) that you need to add to your DNS records. This allows you to add dedicated IP addresses and make other account updates without having to manage your SPF records manually. To disable this behavior, uncheck **Use automated security** when completing the domain authentication process. With automated security disabled, Twilio SendGrid provides you with TXT records like those discussed in this documentation rather than CNAME records. ![Domain Authentication Automated Security]({{root_url}}/img/domain_auth_advanced_settings.png) ### Custom SPF records If you have an SPF record set for your domain already, you must add a unique alphanumeric string before the `all` mechanism of this record in order to authenticate mailings through your SendGrid account. If you do not have an existing SPF record for your domain, you must create a TXT record with the value provided to you during the [domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) process. Each SendGrid account gets a unique SPF TXT record to authenticate their outbound mailings. An example of such a record is: ```text v=spf1 include:u123456.wl.sendgrid.net -all ``` In this example, we have a unique SPF record for the authorization of outbound mail for a SendGrid account. A `-all` inclusion versus an `~all` inclusion indicates that this SPF record is the only record used to authenticate mail for your domain. Make sure to include any other authorized sender into this SPF record if you need to authenticate mailings from other sources. Do not create more than one SPF1 record for a given domain. If more than one SPF1 record exists for a domain, you will want to merge any additional SPF records into one SPF record. You also cannot have [more than 10 DNS lookups]({{root_url}}/ui/account-and-settings/spf-limitations/) in your single SPF record. ## Working with an existing SPF record If you already have an SPF record for your domain, you need to add your SendGrid account's unique SPF inclusion into your existing record. For example, say your existing record looks like this: ```text v=spf1 a mx include:\_spf.google.com include:spf.protection.outlook.com -all ``` You would need to add the SendGrid lookup at the end of the string, before the `all` mechanism, like so: ```text v=spf1 a mx include:\_spf.google.com include:spf.protection.outlook.com include:u826348.wl.sendgrid.net -all ``` ## Don't want to include another hostname lookup? If you would rather not include SendGrid's SPF hostname lookup in your record, or perhaps you have [too many already]({{root_url}}/ui/account-and-settings/spf-limitations/), you can also choose to give permission to a **specific IP address** to send mail for your domain. This is accomplished using the `ip4` mechanism within your SPF record. You can choose to specify your [dedicated IP address]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/) as a lookup, which means that only mail coming from that particular IP address will be considered a permitted sender within SendGrid for that domain. An example of this looks like: ```text v=spf1 a mx include:\_spf.google.com include:spf.protection.outlook.com ip4:12.34.56.78 -all ``` If you wish to add multiple `ip4` lookups (if you have an account that sends from multiple dedicated IPs, for example), add them to your record separated by spaces. Unlike with `include:hostname` lookups, a SPF1 record can have any number of `ip4` includes. For more information on official SPF best practices and syntax, you can find the SPF specification at [www.openspf.org](http://www.open-spf.org/). ## Additional Resources * [Sender Identity](/for-developers/sending-email/sender-identity/) * [Domain Authentication](/ui/account-and-settings/how-to-set-up-domain-authentication/) * [Single Sender Verification](/ui/sending-email/sender-verification/) * [DKIM Records Explained]({{root_url}}/ui/account-and-settings/dkim-records/) * [How to Implement DMARC]({{root_url}}/ui/sending-email/how-to-implement-dmarc/) ================================================ FILE: content/docs/ui/account-and-settings/sso-okta.md ================================================ --- layout: page weight: 0 group: account-management title: Twilio SendGrid Single Sign-On with Okta seo: title: Twilio SendGrid Single Sign-On with Okta description: Configure Single Sign-On with SendGrid and the Okta IdP keywords: SSO, Authentication, Password, SAML, Okta navigation: show: true --- <call-out type="beta"> Twilio SendGrid Single Sign-On is currently in beta. The following documentation and product interface may change as the product is improved. </call-out> The following guide will help you add Twilio SendGrid Single Sign-On (SSO) as an integration to your Okta Admin Console. This guide covers the steps necessary to work with Okta only. The following prerequisites should be completed before proceeding with this guide. ## Prerequisites Adding an SSO configuration requires some back-and-forth between the Service Provider (Twilio SendGrid) and your IdP (Okta). The Twilio SendGrid App will provide values required by Okta. Likewise, Okta will provide values required by Twilio SendGrid. You should retrieve values from the Twilio SendGrid App for the fields listed in the following table before proceeding. To understand how to retrieve these values, please follow the instructions in our [main SSO documentation]({{root_url}}/ui/account-and-settings/sso/). Twilio SendGrid, Okta, and other identity providers often refer to the same values by different names. The table below provides the name used by both Okta and Twilio SendGrid, a short description for each required field, and which application provides the information during setup. <table> <tr> <th>Twilio SendGrid label</th> <th>Okta label</th> <th>Provided by</th> <th>Description</th> </tr> <tr> <td>Name</td> <td>Name</td> <td>Twilio SendGrid</td> <td>The name of your integration. This name can be anything that makes sense for your organization (e.g., "Twilio SendGrid" or "Email")</td> </tr> <tr> <td>Single Sign-On URL</td> <td>Single sign on URL</td> <td>Twilio SendGrid</td> <td>The URL where Okta should POST its SAML response. This URL is responsible for receiving and parsing a SAML assertion. This is the same URL as the Audience URL when using Twilio SendGrid.</td> </tr> <tr> <td>Audience URL (SP Entity ID)</td> <td>Audience URL (SP Entity ID)</td> <td>Twilio SendGrid</td> <td>The URL where Okta should POST its SAML response. This URL is responsible for receiving and parsing a SAML assertion. This is the same URL as the Single Sign-On URL when using Twilio SendGrid.</td> </tr> <tr> <td>N/A</td> <td>Application username</td> <td>N/A</td> <td>This should be set to "Email" when using Twilio SendGrid.</td> </tr> <tr> <td>Embed Link</td> <td>Identity Provider Single Sign-On URL</td> <td>Okta</td> <td>Okta's SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow.</td> </tr> <tr> <td>SAML Issuer ID</td> <td>Identity Provider Issuer</td> <td>Okta</td> <td>An identifier provided by Okta to identify Twilio SendGrid in the SAML interaction.</td> </tr> <tr> <td>X509 Certificate</td> <td>X.509 Certificate</td> <td>Okta</td> <td>This certificate is used by Twilio SendGrid to verify that SAML requests are coming from Okta.</td> </tr> </table> ## Add the Twilio SendGrid application to Okta With the prerequisite values prepared, you can begin adding your Application in the Okta Developer Console. The URL for this console will likely follow the pattern: `<your subdomain>.okta.com/admin/dashboard`. 1. Once in the Developer Console, navigate to **Applications** > **Applications**. You will see a list of active applications and an **Add Application** button. ![The Okta Applications Page]({{root_url}}/img/okta-applications-applications.png "Okta Applications") 2. Click **Add Application** to load a view of **Featured Integrations**. You can ignore these integrations and click **Create New App** to start the "Application Integration Wizard." ![The Okta Create New Application Page]({{root_url}}/img/okta-create-application.png "Okta Create New Application") 3. In the modal that loads, select **Web** from the **Platform** drop-down menu, select **SAML 2.0** as the **Sign on method**, and click **Create**. ![Create a New Application Integration modal]({{root_url}}/img/okta-sign-on-method-modal.png "Create a New Application Integration") 4. A screen will load where you should add the **App name**. We recommend "Twilio SendGrid," but you can choose anything that makes sense for your organization (e.g., Email). You can optionally upload a logo and choose whether or not to display it to users. Click **Next** to continue. <call-out> You can download the Twilio SendGrid logo from our brand assets page at https://sendgrid.com/resource/brand/. </call-out> ![Okta Create Integration page]({{root_url}}/img/okta-new-integration-general-settings.png "Create Integration") 5. You will now begin adding the values listed in the prerequisites of this guide to the fields in the Okta **Configure SAML** form. ### Okta SAML settings **SAML Settings** - **Single Sign on URL**: The Single Sign-on URL provided by the Twilio SendGrid App. - **Use this for Recipient URL and Destination URL**: Leave this box checked. - **Allow this app to request other SSO URLs**: Leave this box unchecked. - **Audience URI (SP Entity ID)**: The Audience URI (SP Entity ID) provided by the Twilio SendGrid App. - **Default RelayState**: Leave this field blank. - **Name ID format**: Leave this field set to, **Unspecified**. If you are using an IdP other than Okta, you may need to set this to "emailAddress." - **Application username**: Select, **Email**. **Attribute Statements(optional)** - **Name**, **Name format**, **Value**: Leave these fields blank. **Group Attribute Statements (optional)** - Leave this section blank. 6. Select **Next** at the end of the **Configure SAML form**. ![Okta Create SAML Integration settings page]({{root_url}}/img/okta-saml-settings.png "Create SAML Integration settings") 7. You will now be able to select whether you are a customer or partner on the next page. You should select **I'm an Okta customer adding an internal app**. Then select **Finish**. 8. A new page will load displaying the **Sign On** tab for your application. In this tab, you should see a message stating that "SAML 2.0 is not configured until you complete the setup instructions." Click on **View Setup Instructions**. ![Okta View Setup Instructions]({{root_url}}/img/okta-view-setup-instructions.png "View Setup Instructions") 9. A new tab will open with the information required by the Twilio SendGrid App to complete SAML setup. See "IdP settings" in the [Twilio SendGrid SAML SSO documentation]({{root_url}}/ui/account-and-settings/sso/#idp-settings) for instructions on adding this information to the Twilio SendGrid App. ## Edit your existing Twilio SendGrid application in Okta Once you have added Twilio SendGrid to Okta, you may need to modify the integration. 1. To edit an existing integration, navigate to **Applications** > **Applications**. Select the Twilio SendGrid application from the list of active applications. 2. The Twilio SendGrid integration will load. You can modify your **App Settings** or retrieve the values required to integrate with Twilio SendGrid from the **General** tab. 3. You can add or remove users from the application using the **Assignments** tab. ![Okta Applications menu with the "General" tab open]({{root_url}}/img/sso_okta_edit_integration.png "Okta Applications Genral tab") ## Adding users to your Okta Application Once you complete your Okta configuration in the Twilio SendGrid App, you will be able to manage your users. 1. To assign a user to the Twilio SendGrid Application in Okta, navigate to **Applications** > **Applications** in the Okta Admin interface. 2. You will see a list of your active applications. From the action menu beside your Twilio SendGrid application, select **Assign to Users**. ![Okta action menu, assing to users]({{root_url}}/img/okta-assing-to-users-modal.png "Assign to Users") 3. A modal will load where you can search for and assign users to the application. These users' email addresses should match the email addresses assigned to them as SSO Teammates in the Twilio SendGrid App. ## Completing setup with Twilio SendGrid To further manage users, remove an IdP integration, or make other changes to your integration, please return to the [main Twilio SendGrid SAML SSO documentation]({{root_url}}/ui/account-and-settings/sso/) for next steps. ## Additional Resources Okta provides its own developer documentation, which may be helpful depending on your integration needs. - [Okta](https://developer.okta.com/docs/guides/build-sso-integration/saml2/create-your-app/) ================================================ FILE: content/docs/ui/account-and-settings/sso.md ================================================ --- layout: page weight: 0 group: account-management title: SendGrid Single Sign-On seo: title: SendGrid Single Sign-On description: Configure Single Sign-On with SendGrid keywords: SSO, Authentication, Password, SAML navigation: show: true --- <call-out type="beta"> Twilio SendGrid Single Sign-On is currently in beta. The following documentation and product interface may change as the product is improved. **Known limitations during beta** Twilio SendGrid SSO does not currently support granting an SSO user access to more than one Subuser without granting the SSO user administrator access at the top level of your Twilio SendGrid account. </call-out> ## SSO beta release schedule Single Sign-On is being released in phases for each plan type. The table below provides an estimated release schedule — the provided dates are estimates only and may change. See our [pricing page](https://sendgrid.com/pricing/) for a list of all Twilio SendGrid plans and features. <table> <thead> <tr> <th>Twilio SendGrid Plan</th> <th>Estimated Availability</th> </tr> </thead> <tbody> <tr> <td>Marketing Campaigns Advanced</td> <td>Now available</td> </tr> <tr> <td>Email API Pro</td> <td>May 31st - June 11th</td> </tr> <tr> <td>Email API Premier and Custom</td> <td>June 14th - June 25th</td> </tr> </tbody> </table> ## Introduction to Twilio SendGrid SSO Twilio SendGrid Single Sign-On (SSO) uses the widely supported [Security Assertion Markup Language (SAML 2.0)](https://en.wikipedia.org/wiki/SAML_2.0) to integrate your Twilio SendGrid user authentication with identity and access management platforms such as [Okta](https://www.okta.com/), [Duo](https://duo.com/), and [Microsoft Azure Active Directory](https://azure.microsoft.com/en-us/services/active-directory/). ### Terminology SSO and SAML terminology is defined throughout this document. Twilio SendGrid will commonly be referred to as the **Service Provider (SP)**. An identity management provider such as Okta will commonly be referred to as the **Identity Provider (IdP)**. One IdP often uses different terminology from another to label the same required fields in a SAML configuration. This document attempts to clarify and call attention to the alternative terminology used by IdPs whenever possible. ## Access and manage your SSO settings The Twilio SendGrid [SSO settings menu](https://app.sendgrid.com/settings/sso) allows you to configure integrations with your IdP(s). Managing users and permissions is covered in the [user management section](#manage-users) of this document. ### Add a Twilio SendGrid SSO Configuration Adding an SSO configuration requires some back-and-forth between the Service Provider (Twilio SendGrid) and the IdP. The Twilio SendGrid App will provide values required by your IdP. Likewise, your IdP will provide values required by Twilio SendGrid. This document will cover the exchange in sections, beginning from the Twilio SendGrid App. You can find IdP-specific documentation for some of the most popular IdPs in the [Additional Resources section](#additional-resources). #### Twilio SendGrid Service Provider settings To add, delete, or modify an SSO integration, log in to the top level of your Twilio SendGrid account using your administrator credentials. 1. Once logged in, navigate to **Settings** and select **SSO Settings**. 2. The SendGrid App will display a page with an **Add Configuration** button. ![The Twilio SendGrid SSO Settings page]({{root_url}}/img/sso-sso-settings-nav-link.png 'SSO Settings') 3. Click **Add Configuration**. A page will load and display the following configuration values needed by your IdP. - **Name**: A friendly name for your IdP configuration. This **Name** will be set to “My IdP configuration” by default. You can change it to something that will help you differentiate it from additional IdP configurations you add later. - **Single Sign-On URL**: The Twilio SendGrid URL where your IdP should POST its SAML response. This URL is responsible for receiving and parsing a SAML assertion. The Single Sign-On URL and the Audience URL are the same when using Twilio SendGrid. - **Audience URL (SP Entity ID)**: The Twilio SendGrid URL where your IdP should POST its SAML response. This URL is responsible for receiving and parsing a SAML assertion. The Audience URL and the Single Sign-On URL are the same when using Twilio SendGrid. - **SP Public Key**: The SP Public Key may not be required by your IdP. It is used to verify that requests are coming from the correct Service Provider. - **Additional Fields**: The following fields may or may not be required by your IdP. If they are required, you can provide the following values. - **Default RelayState**: This field is not applicable; leave it blank. - **Name ID format**: "unspecified." If your IdP generates an error with this field set to "unspecified", try setting it to "emailAddress." - **Application username**: "Email" ![The Twilio SendGrid SSO IdP Configuration page]({{root_url}}/img/sso-add-configuration-values.png 'Add IdP Configuration') 4. You can now add the values for each field to your IdP. 5. Your IdP will also provide values necessary to complete the SSO setup in the Twilio SendGrid App. #### IdP settings Once you have added the previous settings where appropriate in your IdP, your IdP will provide the values necessary to complete the setup in the Twilio SendGrid App. 1. From the page displaying your SendGrid SSO configuration, click **Next**. A page will load and display the following SAML fields. The necessary values are provided by your IdP. - **SAML Issuer ID**: An identifier provided by your IdP to identify the Service Provider in the SAML interaction. Your IdP may call this an "Entity ID," "Identity Provider Issuer," "Azure AD Identifier," or other identifier. - **Embed Link**: The IdP’s SAML POST endpoint. This endpoint should receive requests and initiate an SSO login flow. Your IdP may call this the "Identity Provider Single Sign-On URL," "Login URL," or some other authentication URL. 2. Copy the values from your IdP to the appropriate fields in the Twilio SendGrid App. ![The "Add IdP Configuration" menu in the Twilio SendGrid App.]({{root_url}}/img/sso-IdP-configuration-value2.png 'Add IdP Configuration') 3. Click **Add Certificates** to load the configuration menu. The loaded modal will have one field labeled **X509 Certificate**. This certificate is used by Twilio SendGrid to verify that SAML requests are coming from an IdP it knows and trusts. 4. Paste the certificate provided by your IdP into the **X509 Certificate** field and click **Add Certificate**. ![The "Add X509 Certificate" modal in the Twilio SendGrid App.]({{root_url}}/img/sso-x509-cert-sidebar.png 'Add X509 Certificate') 5. The modal will close after you click **Add Certificate**. You can now select **Enable SSO** to complete the configuration. You can also **Save without enabling**. Your SSO configuration should now be complete. You can follow the next steps in this document to edit or delete a configuration. You can also skip to the [user management](#manage-users) section to begin onboarding SSO users. ### Disable or enable an SSO IdP Configuration You can toggle the state of a configuration by selecting **Settings** > **SSO Settings** from the left sidebar navigation of the Twilio SendGrid App. 1. A page will load displaying all your existing IdP configurations. 2. Each configuration will have an action menu to the far right. Select this menu to display a dropdown where you can choose **Edit** or **Disable**. ![The SSO settings page with an SSO configuration and its action menu expanded.]({{root_url}}/img/sso-configuration-action-menu-expanded.png 'Edit or Disable SSO configuration') 3. Selecting **Disable** will load a modal asking you to confirm your decision. Disabling a configuration will inactivate the configuration but will not delete it. Once disabled, any SSO users whose access is tied to the configuration will no longer be able to authenticate with Twilio SendGrid. ![The SSO settings modal asking to confirm that you want to disable the configuration.]({{root_url}}/img/sso-configuration-disable-confirmation-modal.png 'Disable SSO configuration') 4. To reenable a configuration, select the action menu. For any disabled configuration, you will see the options to **Edit** or **Enable**. 5. Selecting **Enable** will reactivate the configuration for any Teammates assigned to it. ### Edit or delete an SSO IdP configuration You can edit or delete a configuration by selecting **Settings** > **SSO Settings** from the left sidebar navigation. 1. A page will load displaying all your existing IdP configurations. 2. Each configuration will have an action menu to the far right. Select this menu to display a dropdown where you can choose **Edit** or **Disable**. ![The SSO settings page with an SSO configuration and its action menu expanded.]({{root_url}}/img/sso-configuration-action-menu-expanded.png 'Edit or Disable SSO configuration') 3. Select **Edit** from the action menu. A page will load that allows you to modify or complete an unfinished SSO integration. 4. After modifying any of the fields in your configuration, select **Save** at the bottom of the page. 5. To delete the configuration, select **Delete <name of your configuration>**. ![The "Edit My IdP Impletmentation" page.]({{root_url}}/img/sso-edit-IdP-configuration-page.png 'Edit my IdP implementation') 6. When you select **Delete <name of your configuration>**, you will be presented with a modal asking you to confirm the deletion. ![A modal asking you to confirm the deletion of your IdP configuration.]({{root_url}}/img/sso-delete-configuration-confirmation-modal.png 'Delete this IdP configuration') ## Manage users Once you have successfully enabled an SSO IdP configuration, you will need to add SSO users to the account. Twilio SendGrid calls these users Teammates. An account administrator can add two types of Teammates to an account: SSO Teammates and Password Teammates. Password Teammates will log in with a username, password, and Twilio SendGrid 2FA. This documentation covers the SSO Teammate setup only. For more information about our Teammates feature, see the dedicated [Teammates documentation]({{root_url}}/ui/account-and-settings/teammates/). <call-out> Twilio SendGrid does not currently offer a migration tool that will convert existing Teammates to SSO Teammates. You must manually add existing Password Teammates as SSO Teammates to your account. </call-out> <call-out> Twilio SendGrid requires Two-factor Authentication (2FA) to access its services. This means that any account administrators who access Twilio SendGrid outside of an SSO configuration must enable 2FA. See our [2FA documentation]({{root_url}}/ui/account-and-settings/two-factor-authentication/) for more information. Configuring 2FA for SSO Teammates should not be done in the Twilio SendGrid App. You will manage any 2FA requirements for your SSO Teammates in your IdP. For example, the Okta or Duo apps may be configured to send Push or SMS notifications. </call-out> ### Add a Teammate 1. To add a Teammate, navigate to **Settings** and select **Teammates**. 2. A page will load displaying any existing Teammates. If there are no existing Teammates, you will see a **Get started creating teammates** button. 3. Click the **Add Teammate** button at the top of the page to display a dropdown menu with options to **Add password teammate** or **Add SSO teammate**. ![The Twilio SendGrid Teammates App page.]({{root_url}}/img/sso-teammates-add-teammate.png 'Add a Teammate') 4. Select **Add SSO teammate**. A menu will load and display the following fields required to create the Teammate. - **Teammate’s Email Address**: Twilio SendGrid will use this email address as the primary identifier when authenticating the SSO user. For this reason, a Teammate’s email address must match the address you assign it in your IdP, and the address cannot be changed after you create it. If a single user must access multiple accounts, you will need to configure your IdP to pass through a unique email address for each account+user pair; these unique email addresses must be added as SSO Teammates in the Twilio SendGrid App. - **Teammate’s First Name**: The Teammate’s first name. - **Teammate’s Last Name**: The Teammate’s last name. - **Teammate’s Permissions**: - **Add as Admin**: Administrators can fully manage the Twilio SendGrid account. They have the ability to add, remove, and edit other Teammates. - **Add with Read-Only Access**: Read-only permissions allow a Teammate to work within the SendGrid App to send email, manage templates, and perform other email-related tasks; however, a read-only Teammate cannot manage other Teammates. - **Add with Restricted Access**: You can finely control a user's permissions by creating a Teammate with restricted access. For example, a software developer may need to create API keys but never require billing access. The Twilio SendGrid App also provides permission presets that will toggle on the access most often needed by common types of users. ![The "Add SSO Teammate" modal with a restricted access user selected.]({{root_url}}/img/sso_teammate_restricted_access.png 'Add SSO Teammate') 5. With all the fields complete, click **Add** to finish creating the Teammate. ### Edit a Teammate Existing Teammates can be edited from the **Settings** > **Teammates** page of the Twilio SendGrid App. 1. On the Teammates management page, each Teammate will have an action menu on the far right. Click the action menu to reveal **Edit** and **Delete** options. ![An SSO Teammate with the action menu open to edit or delete the Teammate.]({{root_url}}/img/sso-teammate-action-menu.png 'Edit or Delete an SSO Teammate') 2. Selecting **Edit** from the action menu will load a sidebar modal with the same fields that were present when adding the Teammate. You can edit any of the fields except the **Teammate’s Email Address**, which cannot be changed after the Teammate is created. ### Remove a Teammate Existing Teammates can be deleted from the **Settings** > **Teammates** page of the Twilio SendGrid App. 1. On the Teammates management page, each Teammate will have an action menu on the far right. Click the action menu to reveal **Edit** and **Delete** options. ![An SSO Teammate with the action menu open to edit or delete the Teammate.]({{root_url}}/img/sso-teammate-action-menu.png 'Edit or Delete an SSO Teammate') 2. Selecting **Delete** from the action menu will load a modal asking you to confirm the deletion. ![A modal asking you to confirm the deletion of a Teammate]({{root_url}}/img/sso-teammate-delete-modal.png) ## User authentication flow User authentication can be initiated in two ways: from the Service Provider or from the IdP. We call these SP-initiated and IdP-initiated authentication flows respectively. ### SP-initiated authentication flow The SP-initiated flow occurs when a user authenticates directly with the Twilio SendGrid App. When a user enters their email address, Twilio SendGrid performs a check and redirects any email address associated with an SSO account to the SSO login page. Users will then authenticate by entering their IdP credentials. ### IdP-initiated authentication flow The IdP-initiated flow occurs when a user authenticates with their IdP. For example, a user may click on the SendGrid app tile from Okta. This flow will authenticate the user and redirect them to the Twilio SendGrid App. ## Additional Resources - [The Twilio SendGrid SSO REST API]({{root_url}}/api-reference) **Twilio SendGrid IdP guides** - [Twilio SendGrid Single Sign-On with Okta]({{root_url}}/ui/account-and-settings/sso-okta/) **IdP documentation sites** - [Okta](https://developer.okta.com/docs/guides/build-sso-integration/saml2/create-your-app/) - [Microsoft Azure Active Directory](https://docs.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-sso) - [Duo](https://duo.com/docs/sso-generic) ================================================ FILE: content/docs/ui/account-and-settings/subusers.md ================================================ --- layout: page weight: 0 group: teammates-subusers title: Subusers seo: title: Subusers description: Create and Manage Subusers keywords: Subuser settings, create Subuser, manage Subuser, delete Subuser navigation: show: true --- Subusers help you segment your email sending and API activity. You assign permissions and credit limits when you create the subuser. We recommend creating subusers for each of the different types of emails you send - one subuser for transactional emails, and another for marketing emails. Breaking your sending up this way allows you to get separate statistics for each type of email you send. <call-out> If you have a **Pro or Premier API plan** or an **Advanced Marketing Campaigns Plan**, you may create up to 15 subusers through your account. If you reach the maximum of 15 and require more subusers, please use the form in the [Subuser Management](https://app.sendgrid.com/settings/subusers) page to request more. </call-out> ## Create a subuser New SendGrid accounts do not come with subusers; you must create them with the parent account. *To create a subuser:* 1. Navigate to **Settings** and select **Subuser Management**. 1. Click **Create New Subuser**. 1. Enter the following required information into the corresponding fields: * Username - The username your subuser will use to send emails and access the API. * Email Address - The contact email address for this subuser. This must be an active email account as SendGrid may contact a subuser to provide support, resolve sending and deliverability issues, or to enforce [SendGrid's Terms of Service](https://sendgrid.com/policies/tos/). Whenever we contact a subuser, it is our policy to contact the parent account email address at the same time. * Password - The password your subuser will use to access SendGrid.com. * Avatar - If you have [gravatar](http://gravatar.com), or globally recognized avatar, that you use for other applications, it is automatically associated with this subuser when you enter an email address. This makes it easier to identify all of the subusers attached to your account. 4. Assign an IP Address to the subuser account. You are assigned a dedicated IP address when you create a Pro 100k plan or higher. If you send at a high volume, and you're using subusers to separate out your sending traffic, it's best practice to purchase a separate IP for each sending type. ## Manage subusers Subusers can be managed via [Subuser API](https://sendgrid.api-docs.io/v3.0/Subusers-api) or by using the SendGrid UI. *To manage a subuser from the SendGrid UI:* 1. Navigate to **Settings** and select **Subuser Management**. 1. Select the name of the subuser. This takes you to the subuser’s account and profile settings. From there, you can manage and update your subuser Settings. ### Optional Profile Information We do not require this information for your subusers, but we suggest that you fill out as much as possible to improve the deliverability for this subuser, especially if the information does not match your parent account’s information. This will also allow SendGrid to contact your subuser directly if we notice anything on their account. The following fields in the subuser profile are optional: **First Name** - The first name of the person responsible for this subuser. **Last Name** - The last name of the person responsible for this subuser. **Company** - The name of your subuser’s company. **Address 1** - The first line of your subuser’s address. **Address 2** - The second line of your subuser’s address. **City** - The city in which your subuser operates. **State** - The state or province in which your subuser operates. **Country** - The country in which your subuser operates. **Zip** - The zip code in which your subuser operates. **Company Phone Number** - The phone number for your subuser’s business. **Company Website** - The website for your subuser’s business. ### Allocating or removing credits from a subuser <call-out type="warning"> You can only allocate credits by selecting the nonrecurring credit option. </call-out> If your Subuser account has nonrecurring credits, you can allocate credits to, or remove credits from this subuser account. On the subuser's profile, click **Change Credit Rules** and then choose the appropriate credit amount for the subuser. ### Monitoring subuser email content This feature allows you to receive a sample of a subuser's email content to help ensure that the content is not damaging your reputation. <call-out type="warning"> Each monitor email costs one email credit. </call-out> The “Collect Sample Rate” is the number of emails SendGrid will allow through before copying the email address you set on the next email sent. For example, if you set the collect sample rate at 100, then you will receive a copy of every 100th email this subuser sends. ### Disabling a subuser account *To turn off a subuser’s access to SendGrid temporarily:* 1. Navigate to **Settings** and select **Subuser Management**. 1. Locate the subuser account you wish to disable and click on the name to view the account details. 1. Click **Disable Account**. To re-enable a subuser’s account, follow steps 1 and 2 above, then click **Enable Account**. ### Deleting a subuser account <call-out type="warning"> Deleting a subuser account cannot be undone. Please make sure that you are ready to delete this account before you delete it. Deleting this subuser will immediately revoke all access. </call-out> *To delete a subuser account:* 1. Navigate to **Settings** and select **Subuser Management**. 1. Locate the subuser account you wish to delete and click on the name to view the account details. 1. On the *Account Settings* page, click **Delete**. A confirmation window appears. 1. Click **Confirm** to delete the subuser account. ## Adding subusers to Dedicated IP Addresses You will need to have a dedicated IP address already. Adding subusers to dedicated IP addresses can help you separate your sending traffic, improving your deliverability rate. 1. Navigate to **Settings** and select [Subuser Management](https://app.sendgrid.com/settings/subusers). 1. Select the subuser to assign the dedicated IP. 1. Select **Change Sending**. 1. Under IP Addresses, select an IP address to assign to the subuser. 1. Select **Save**. ## Impersonating a Subuser When you set up subusers, it may be useful to see what the subuser’s settings are and to see what the subuser can see in the SendGrid UI. To make this easier, we’ve made it so you can impersonate a subuser from your parent account and then manage the subuser the same way as if you had logged in with that user’s credentials, without having to log out of your parent account. *To impersonate a Subuser:* 1. Log into SendGrid. 2. Go to the top left corner of the portal screen and click on your name just above the navigation menu. 3. Click **Switch User**. 4. Choose the subuser you want to impersonate by clicking that subuser’s name. The page will refresh, and you will notice a message at the top of the screen that says, “You're currently logged in as [subuser name]”. If you have more than one subuser, you can also switch to another subuser by clicking **Switch Subuser** in the top-right corner once you are impersonating any subuser. ### Switching back to your parent account Click the link at the top left that says “Back to Parent Account”. This will log you out of the subuser account and take you back to your parent account portal. ## Export subuser Information If you would like to see how your subusers are performing in comparison to each other, you can export subuser data. *To export subuser information:* 1. Navigate to **Settings** and select **Subuser Management**. 1. Click **Export Data**. <br>This downloads a CSV file with each subuser’s reputation, the number of requests they made this month, and the number of requests they made last month. ## Additional Resources - [Assigning an Authenticated Domain to a subuser]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/#assigning-a-subuser) - [Teammates]({{root_url}}/ui/account-and-settings/teammates/) ================================================ FILE: content/docs/ui/account-and-settings/support.md ================================================ --- seo: title: Contacting SendGrid Support description: SendGrid support contact information keywords: SendGrid support, support contact, sendgrid support chat, sendgrid support phone number title: How to contact SendGrid support weight: 0 group: account-management layout: page navigation: show: true --- <iframe src="https://player.vimeo.com/video/263354373" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <div class="row"> <div class="col-md-4"></div> <div class="col-md-4"> <a href="https://support.sendgrid.com/" class="btn btn-large btn-primary center-block">Contact Support</a> </div> <div class="col-md-4"></div> </div> You can contact SendGrid support from the [SendGrid Support Portal](https://support.sendgrid.com). Click **Login & Contact Support**, and then **Contact Support** to see your support contact options. Paying SendGrid customers have the option to contact support via chat, or by submitting a ticket using our web form. SendGrid customers with a Pro or higher tier plan have access to phone support as well. All SendGrid customers have the option to submit a ticket using our web form. ## Support Hours * Ticket support - 24/7 * Chat support - 24/7 (For paying customers) * Phone support is available for customers with a Pro or higher account 7:00AM - 5:00PM MST, Monday - Friday. ================================================ FILE: content/docs/ui/account-and-settings/taxes-and-tax-exempt.md ================================================ --- seo: title: Sales Taxes and Tax-Exempt Status description: Understand where SendGrid charges taxes, and how to let us know if you have tax-exempt status. keywords: taxes, tax jurisdictions, tax-exempt title: Sales Taxes and Tax-Exempt Status weight: 0 group: billing layout: page navigation: show: true --- SendGrid now collects sales tax in several US states and metro areas (see below for more details). We assign tax jurisdiction by the billing address you have in our system. If your billing address is in one of these jurisdictions, and you don't have 501(c)(3) tax-exempt status, you will see a line for sales tax [on your invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/). For more information about declaring your tax-exempt status, see [Declaring tax-exempt status](#declaring-tax-exempt-status). ## Declaring tax-exempt status To declare tax-exempt status, email your 501(c)(3) (or equivalent) documentation to billing@sendgrid.com. When we receive your paperwork, we'll verify it, and assign you tax-exempt status. ## Declaring reseller status Resellers are responsible for collecting and verifying their own taxes and taxes for their customers, including sales tax. To declare your status as a SendGrid reseller, email your state reseller permit, purchase for resell exemption certificate, or similar document to billing@sendgrid.com. When we receive your paperwork, we'll verify it, and assign you reseller status. ## Tax FAQ ### Why does SendGrid collect sales tax? If SendGrid has a physical presence in a jurisdiction, and we directly sell a taxable product to someone located in that jurisdiction, then we are required to collect sales tax on behalf of that jurisdiction. ### Who is required to pay sales tax? SendGrid collects sales tax in the following jurisdictions: - Alabama - Arizona - Arkansas - California - Colorado - Connecticut - Florida - Georgia - Hawaii - Idaho - Illinois - Iowa - Indiana - Kansas - Kentucky - Louisiana - Maine - Maryland - Massachusetts - Michigan - Minnesota - Mississippi - Missouri - Nebraska - Nevada - New Jersey - New Mexico - New York - North Carolina - North Dakota - Ohio - Oklahoma - Pennsylvania - Rhode Island - South Carolina - South Dakota - Tennessee - Texas - Utah - Virginia - Washington - Washington D.C. - West Virginia - Wisconsin - Wyoming - US metro areas include Denver, Boulder and Chicago To determine whether to add sales tax to your monthly SendGrid bill, we use the address you enter as your billing address in [Account Details](https://app.sendgrid.com/account/billing) in the SendGrid UI. ### Where can I see how much I am getting charged for sales tax each month? If you are being charged sales tax, you will see it as a line item on your invoice. You’ll be able to find the new sales tax line item by navigating to [Account Details](https://app.sendgrid.com/account/billing) in the SendGrid UI, then by viewing your invoice, which is in PDF form. ### Can I get an estimate of my sales tax? Unfortunately, we cannot provide estimates of sales tax for an individual customer ahead of time. The taxes assessed could change monthly for various reasons such as state or local tax laws changing. You can check your bill throughout the month for an estimate of your sales tax. ### Will my tax amount vary from month to month? Taxes charged can vary month-to-month based on local tax laws changing, or if your product mix causes your bill to be greater or less than in previous months. ### How does SendGrid calculate the sales tax owed? Tax laws change regularly, so we work with a third party software that focuses on deeply understanding local and state tax laws. SendGrid uses this software to calculate the sales tax you are charged each month. ### Other questions? If you have any other questions about taxes, send an email to billing@sendgrid.com. ================================================ FILE: content/docs/ui/account-and-settings/teammates.md ================================================ --- seo: title: Teammates description: Adding and managing Teammates using the SendGrid UI keywords: teammates, teammate, permissions title: Teammates weight: 0 group: teammates-subusers layout: page navigation: show: true --- Teammates allows multiple users, or teammates, to send email from a single SendGrid account. It enables groups of users with different roles and responsibilities to share one account, where each of these users has access to varying SendGrid features depending on their needs. By only giving your individual team members access to the features that they need to do their jobs, you can limit access to sensitive areas of your account. Teammates makes it incredibly easy to add, remove, and manage different users. Free and Essentials customers can create 1 teammate per account, and Pro customers or higher packages up to 1000 teammates. <call-out> Free and Essentials customers can create 1 teammate per account, and Pro customers or higher packages up to 1000 teammates. </call-out> ## Adding Teammates _To invite a Teammate to your account:_ 1. Navigate to **Settings**, and click on **Teammates**. <br>This is where you can see the list of all of your current teammates with their details: username, email address, first name, and last name. 2. To add a new Teammate, click **Add Teammate**. 3. Enter the Teammate's email address and then select their permission level. <br>Depending on the selected permission level, you may need to do some additional permission [configuration](#configuring-permissions). 4. Click **Invite**. <br>If you have already sent a teammate invitation, you will see a list titled **Pending Invites**. This list contains the email address of the invitee and the invitation expiration date. <call-out type="warning"> Teammate invitations are valid for 7 days. </call-out> <call-out> While only administrators can create teammates, it is possible for one administrator to create another teammate with administrator permissions. This new teammate would then be able to create and manage other teammates and have access to the account's billing settings. **Please be very careful about who you assign administrator permissions!** </call-out> <call-out> Only administrator teammates may impersonate subusers. </call-out> ## Managing Teammates ### Configuring permissions The 3 different permission levels are: - **Restricted Access -** Teammates with no access to a feature cannot change that feature’s settings or view it within the SendGrid UI. However, you can still [grant them access to specific features](#granting-feature-access). - **Read-only Access -** Teammates with read-only access will not be able to change or configure a feature. However, they will be able to view any information provided by that feature. - **Admin -** Teammates with full access that can view and make any changes. If you select **Invite with Restricted Access** when inviting a Teammate, you need to select a preset access level or create your own by selecting **Custom Access**. You can choose from several pre-defined permission levels to fit a variety of roles: Developer Access, Marketer Access, and Accountant Access or you can customize access for the teammate. _To modify an existing teammate's permissions:_ 1. Navigate to the **Teammates Page** under **Settings**. 1. Under the list of current teammates, click the action menu next to the teammate you would like to edit. 1. Click **Edit** to open a modal window presenting the teammate's current permissions. 1. Make your desired changes and click **Update**. ### Removing Teammates _To delete a teammate:_ 1. Navigate to the **Teammates Page** under **Settings**. 1. Click the action menu next to the teammate you want to delete and click **Delete**. <call-out type="warning"> You cannot recover deleted teammates. Once a teammate has been deleted, it can never be restored. SendGrid will not remove any templates, campaigns, contacts, or API keys created by the teammate. </call-out> ## Requesting feature access If you are already signed into a SendGrid account as a teammate, but do not have access to a page or feature, you may request access to that page by clicking **Request Access**. Once a request is made, all account administrators receive a notification via email that a request is pending approval. ### Granting feature access You can find any access requests listed under **Pending Requests** on the **Teammates** page in your Settings. The request will list the username of the teammate, their email address, their first and last names, along with the feature that they requested access to. To grant that teammate access to the feature, click **Approve**. <call-out type="warning"> **By clicking "Approve" you are giving that teammate full access to the feature!** If you only want to give them limited access to the feature, you must navigate back to their teammate settings to make adjustments to their granular permissions. </call-out> If you do not want to grant them access, click **Deny**. <call-out> The teammate receives a notification email when they are either granted or denied access. SendGrid delivers these emails, but the "reply to" address is the email address on file for the account owner. </call-out> ## Managing Teammates ### Teammates and API Keys API Keys are used to authenticate API calls. Just as a teammate can be given specific permissions, API keys can be assigned specific [permissions](https://sendgrid.api-docs.io/v3.0/api-key-permissions/api-key-permissions) to restrict which API calls they can authenticate. <call-out> API Keys and Teammates can be used as 2 different methods of restricting access to the same SendGrid features. However, a teammate cannot change their own permissions via API key. For example, a teammate with restricted access to features in the SendGrid user interface but full access to API Keys cannot make an API call to modify their permissions in the user interface. </call-out> ## Related Resources - [API Reference](https://sendgrid.api-docs.io/v3.0/teammates/teammates-request-access) - [Glossary]({{root_url}}/glossary/teammates/) ================================================ FILE: content/docs/ui/account-and-settings/tracking.md ================================================ --- seo: title: Tracking Settings description: Track clicks, opens, and subscriptions with SendGrid keywords: click tracking, clicks, open tracking, opens, google analytics, tracking with analytics, subscription tracking title: Tracking Settings weight: 0 group: account-management layout: page navigation: show: true --- ## Click tracking Enabling Click Tracking causes all the links and URLs in your emails to be overwritten and pointed to either SendGrid’s servers or the domain you branded your link with so that any time a customer clicks a link, SendGrid can track those [clicks]({{root_url}}/glossary/clicks/). SendGrid can track up to 1000 links per email. ### Settings **Status** - On or Off ## Google Analytics For more information about using this app, please refer to [Google’s URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on "[Best Practices for Campaign Building](https://support.google.com/analytics/answer/1037445)". We default the settings to Google’s recommendations. Anything you enter into those fields in the app settings or via API will take precedence. For more information see [Google Analytics]({{root_url}}/ui/analytics-and-reporting/google-analytics/). ### Settings **Status** - On or Off **Campaign Source** - Name of the referrer source. (e.g. Google, SomeDomain.com, Marketing Email) **Campaign Medium** - Name of the marketing medium. (e.g. Email) **Campaign Term** - Identify paid keywords. **Campaign Content** - Use to differentiate ads. **Campaign Name** - Name of the campaign. ## Open Tracking <call-out> If you are using email link branding, then your open tracking image will be served from your branded domain instead of from SendGrid.net. </call-out> Open Tracking adds an invisible, one pixel image at the end of the email which can track email [opens]({{root_url}}/glossary/opens/). If the email recipient has images enabled on their email client and a request to SendGrid’s server for the invisible image is executed, then an open event is logged. These events are logged in the Statistics UI, Email Activity interface, and are reported by the Event Webhook. When using this service customers often ask the difference between a unique open versus an open. A unique open is logged only the first time a given recipient opens the email whereas normal opens are logged for all opens of the email in question. ### Settings **Status** - On or Off **Replacement Tag** - If you do not want the open tracking image to be inserted at the end of your email, it is possible to specify an alternative location by using a replacement tag and the open tracking [SMTP API header]({{root_url}}/for-developers/sending-email/smtp-filters/#opentrack). If you are sending email through our [v3 Web API](https://sendgrid.api-docs.io/v3.0/mail-send), you may also enable the `open_tracking` parameter, and set the `substitution_tag` parameter to a value of your choice. You may insert that substitution tag anywhere in your email, and it will be replaced with the open tracking image. **Related Information** - [How Google’s Image Caching effects your opens](https://sendgrid.com/blog/googles-new-image-caching-5-things-need-know/) ## Subscription Tracking Add automatic subscription management links to the bottom of emails. SendGrid will keep track of these unsubscribes and ensure these users don’t get future emails from you. You can customize the text attached to emails and customize the landing page. The links can be configured in whatever fashion suits your needs. ### Settings **Replacement Tag** - Your custom defined tag for your templates. Use this to place your unsubscribe URL wherever you want in your template. If you provide this, make sure you put it within an `<a href=` tag. If you don’t provide this, your default unsubscribe content will be automatically added to the bottom of your email. **HTML Unsubscribe Content** - The information and HTML for your unsubscribe link. In this HTML, you should include the link text you would like displayed in your email within the tag, like so: ```html <% Unsubscribe Here %> ``` **Text Unsubscribe Content** - The information in plain text for your unsubscribe link. You should have the “<% %>” tag in your content, otherwise the user will have no URL for unsubscribing. **Custom Landing Page URL** - The URL where you would like your users sent to unsubscribe. This must be a valid URL. **SendGrid Landing Page (HTML)** - The HTML that will be displayed on the page that your customers will see after clicking unsubscribe, hosted on SendGrid’s server. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://sendgrid.com/docs/ui/analytics-and-reporting/subscribing-to-expert-insights/), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ================================================ FILE: content/docs/ui/account-and-settings/troubleshooting-delays-and-latency.md ================================================ --- seo: title: Troubleshooting Delays and Latency description: Troubleshooting Delays and Latency keywords: down, outage, latency, header, intermittent, trace, ping, wireshark, traceroute, hop, node, slowness, having issues?, delivering, after, mins, minutes, seconds, ms, milliseconds, slow, delay, hours, delays title: Troubleshooting Delays and Latency weight: 0 group: troubleshooting layout: page zendesk_id: 203884108 navigation: show: true --- <call-out> Experiencing delays? Check our [Status Page](http://status.sendgrid.com/) for the current state of all SendGrid Services. </call-out> As you send emails, you may encounter scenarios where mail seems to take more time than it should to get to its final destination. Mail delays can manifest in a number of ways, so we've collected a list of tips to help you try to track them down! ### 1. Check these suggestions first: **1.** If you are integrated with SendGrid using code, we _highly_ recommend using the official SendGrid libraries available on our [GitHub account](https://github.com/sendgrid). These are written with efficiency in mind. If you need help getting started with our libraries, check out the tutorials in each of the languages: * [C Sharp](https://github.com/sendgrid/sendgrid-csharp/blob/master/README.md) * [PHP](https://github.com/sendgrid/sendgrid-php/blob/master/README.md) * [Ruby](https://github.com/sendgrid/sendgrid-ruby/blob/master/README.md) * [Node.js](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md) * [Python](https://github.com/sendgrid/sendgrid-python/blob/master/README.md) * [Go](https://github.com/sendgrid/sendgrid-go/blob/master/README.md) * [Java](https://github.com/sendgrid/sendgrid-java/blob/master/README.md) **2.** You can use our SMTPAPI to greatly increase your message throughput. As with SMTP, 5000 messages can be sent with each connection, but there can be 1000 [TO: recipients]({{root_url}}/for-developers/sending-email/getting-started-smtp/) for each message using the x-smtpapi header. You can use this option through SMTP sending as well as the [Web API v3]({{root_url}}/api-reference). **3.** Lastly, you can try to open additional connections from your end: Generally, we recommend a maximum of 10 concurrent connections. However, please note that SendGrid can generally handle as much mail as you can throw at us. One thing to ensure is to make certain that the maximum amount of mail is passed before terminating each connection. We recommend using caution when incrementing your number of active connections. ### 2. None of those helped, what else can I try? More often that not, one of the 3 suggestions above will resolve a latency problem. However, some latency issues are simply due to the quality of your connection or traffic shaping. There is always the possibility that network problem issue lies with either yours or your ISPs configuration. Below are a number of methods that will help you determine where a latency issue really is. **Hping** 1. We'll begin with [hping](http://www.hping.org/) (or [Test-NetConnection](https://docs.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection?view=win10-ps) as a Windows alternative). You should always test hping to help determine response time and TTL (time to live) in milliseconds. In our troubleshooting scenario below, we'll run a hping command to our SMTP server at **smtp.sendgrid.net** 2. How to run hping: Open “terminal”. Type “sudo hping smtp.sendgrid.net -p 587 -S” and you will see a ping occur continually. ``` sudo hping smtp.sendgrid.net -p 587 -S Password: HPING smtp.sendgrid.net (gpd0 169.45.89.186): S set, 40 headers + 0 data bytes len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=0 win=29200 rtt=40.5 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=1 win=29200 rtt=40.5 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=2 win=29200 rtt=45.7 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=3 win=29200 rtt=42.8 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=4 win=29200 rtt=47.2 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=5 win=29200 rtt=51.8 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=6 win=29200 rtt=42.4 ms len=44 ip=169.45.89.186 ttl=49 DF id=0 sport=587 flags=SA seq=7 win=29200 rtt=45.2 ms ^C --- smtp.sendgrid.net hping statistic --- 8 packets tramitted, 8 packets received, 0% packet loss round-trip min/avg/max = 40.5/44.5/51.8 ms ``` **Anything exceeding 150.000 ms should be the first indication that something may be amiss regarding your network connection. Let your IT department know pronto.** **Hping - traceroute mode** 1. A traceroute is along the same lines as a ping, you can think of a traceroute as a deeper analysis in the sense that it allows you to see at which “hop” the latency may begin to occur. You are able to see every stop along the route that the packet travels from the customer’s network to SendGrid’s servers. At each stop, details are given as to the address it travels to, and the amount of time to get there also in milliseconds. 2. How to run a traceroute: Open “terminal” and type “sudo hping smtp.sendgrid.net -p 587 -S -T -c 10” ``` sudo hping smtp.sendgrid.net -p 587 -S -T -c 10 HPING smtp.sendgrid.net (en0 169.45.113.201): S set, 40 headers + 0 data bytess hop=1 TTL 0 during transit from ip=172.22.16.1 name=UNKNOWN hop=1 hoprtt=2.8 ms hop=2 TTL 0 during transit from ip=4.31.56.1 name=UNKNOWN hop=2 hoprtt=15.9 ms hop=3 TTL 0 during transit from ip=4.69.203.121 name=ae-1-3501.ear3.sanjose1.level3.net hop=3 hoprtt=28.0 ms hop=4 TTL 0 during transit from ip=4.7.16.38 name=UNKNOWN hop=4 hoprtt=25.9 ms hop=5 TTL 0 during transit from ip=50.97.17.78 name=ae6.cbs02.eq01.sjc02.networklayer.com hop=5 hoprtt=25.2 ms ``` **As with the hping method, keep an eye out for any large times over 150.000 ms**. You'll also want to pay close attention to notice if there are any major increases from one hop to the next. This could indicate the inherent latency from when the packet leaves a server in France en route to a server in Canada. Another flag to watch out for are any of the increases early in the transit, as this could mean the latency lies within your local network, or at a certain ISP. Keep in mind that many modern network nodes will de-prioritize ICMP packets, which traceroute sends, so timeouts at certain hops may not necessarily be indicative of a faulty connection. That said, a traceroute can still go along way in helping isolate where a network issue exists. **Google Header Analyzer** Google provides a great free [header analyzer tool](https://toolbox.googleapps.com/apps/messageheader/analyzeheader) that you can use to analyze the headers of an email, and find out how long an email spent in a particular location. For more information on how to grab the original headers from an email, [check here]({{root_url}}/ui/sending-email/checking-email-source/). 1. Grab the headers of the message you want to analyze. Make sure you just grab the received headers, which is everything above the first content boundary. ![]({{root_url}}/images/headersnocontent.gif) 2. Paste them into the header analyzer tool and hit the Analyze button. ![]({{root_url}}/images/headeranalyzer.gif) The results provided should show the exact journey a message takes from one Mail Transfer Agent to the next, and how long it spent at each one! This tool can be invaluable for figuring out who to "blame" for email delays. **Wireshark** 1. In cases the ping and traceroute fail to uncover any obvious lag, a TCP dump or packet capture (PCAP) can tell us a lot. One tool we recommend to help troubleshoot is [Wireshark](https://www.wireshark.org/download.html), as it will capture all packet data from network layers A-D as noted in the network OSI model (missing the physical layer of course). For this reason, it is an extremely thorough tool for analyzing traffic, filtering TCP streams, protocols, and even catching plain text within packets, and much more. 2. Support may ask you for a PCAP sometimes during issue troubleshooting, here is an excellent guide on how to perform the capture and begin using Wireshark [here](http://www.howtogeek.com/104278/how-to-use-wireshark-to-capture-filter-and-inspect-packets/). Make sure that you capture when attempting to send a single message to SMTP.sendgrid.net. Once we receive the PCAP file from the you, we can open it up in Wireshark on our side. The steps below are the same step[s we would take to analyze such a file, so feel free to follow along! 1. <u>Filter on SMTP protocol</u>: First things first. Let’s go ahead and use the filter to peer through the rest of the noise of the capture, and find what we are really interested in. To apply the filter, type “smtp” into the filter box as shown below: ![]({{root_url}}/images/CL_Troubleshooting_Delivery_Issues_16.png) 2. <u>Change time view value</u>: Next thing you want to do is to change the time value. As per Wireshark default, it will be currently listed as Year:Month:Day - Hour:Minutes:Seconds:Milliseconds. To help troubleshoot the delay, go ahead and change this time display to show “seconds since previously displayed packet” and “milliseconds” ![]({{root_url}}/images/CL_Troubleshooting_Delivery_Issues_15.png) 3. <u>Follow TCP stream</u>: This will allow you to see the transaction in a logical view. You can also see and verify the content of the message transmitted in plain text. To do so, go to “analyze->follow TCP Stream” ![]({{root_url}}/images/CL_Troubleshooting_Delivery_Issues_17.png) 4. <u>Expert information tool</u>: This view can let you know right away if there are any red flags with which you should be concerned. To access the expert info, navigate to “analyze->expert info”. When viewing this information, pay attention to the “errors”, “notes”, and “chats” sections. From the errors section, you can see if there are any big errors such as a bad checksum as shown in the example. Keep in mind that It's usually OK to ignore checksum errors on outbound packets. When looking at the notes, it will inform you of suspected concerns. In the example, the notes section informs me of a suspected retransmission on packet 113. This is important, as we will determine later. In the chat section, you can see the sequences and protocols of interest with the summaries. So for example, you can see the connection established, the POST, and awaiting a response. ![]({{root_url}}/images/CL_Troubleshooting_Delivery_Issues_18.png) 5. <u>Calculate Time</u>: Last but not least, it is time to apply a quantitative value to our latency we can see within the transaction. The best way to go about this is to change the time view settings once again. This time, you will want to change it to view to show “time of day” once again leaving the display in milliseconds. If you do the math you are able to determine the total round-trip time for the transaction. ================================================ FILE: content/docs/ui/account-and-settings/troubleshooting-sender-authentication.md ================================================ --- layout: page weight: 0 title: Troubleshooting Sender Authentication group: troubleshooting navigation: show: true seo: title: Troubleshooting Sender Authentication override: true description: Troubleshoot your sender authentication. --- ## My DNS records aren't validating After you add your CNAME, TEXT or MX records to your DNS host, you need to validate them in the SendGrid UI. If your DNS records aren't validating, try these steps: ### Allow your DNS records to propagate Some DNS providers take longer than others to update your DNS records with the CNAME files or TEXT and MX files that we ask you to add. Give it up to 48 hours to validate. ### Auto appending Some DNS hosts will automatically add your top-level domain to the end of DNS records you create, which can turn a CNAME for “email.domain.com” into “email.domain.com.domain.com”. Be sure to follow the convention on existing records in your DNS panel when adding new ones, as sometimes you will only need to add what is to the left of the top-level domain. For example, a CNAME for “email.” becomes “email.domain.com” ### Error validating domain: Expected TXT record at... ``` Error validating domain: Expected TXT record at "m1._domainkey.example.com" to match "k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHLyl8Wk4J06nv56v5+OeEgp9LW3f/""LOlBjWJ9NS4l9X5UlbPJkKeHDXThTig2CxhVuKmIVvRcc9yJ27Tdthj1C1q0rvRtFpNlHbdrJvD8wpxe5rmFeiRPH1KUYbvtbs84aApMwN6Y3A0dgQE7vGkHnPTjwT7q/xv3mu2CvkVntQIDAQAB", but got the following error: lookup m1._domainkey.example.com: no such host ``` If you get an error like this, the problem is that the text record has been split up. The solution is to combine the key back together into one set of quotes, which looks something like this: ``` "k=rsa; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHLyl8Wk4J06nv56v5+OeEgp9LW3f/LOlBjWJ9NS4l9X5UlbPJkKeHDXThTig2CxhVuKmIVvRcc9yJ27Tdthj1C1q0rvRtFpNlHbdrJvD8wpxe5rmFeiRPH1KUYbvtbs84aApMwN6Y3A0dgQE7vGkHnPTjwT7q/xv3mu2CvkVntQIDAQAB" ``` ### DNS record duplication Some DNS providers don't automatically prevent you from duplicating a DNS file. For example, there might be an MX and TEXT record where you are trying to set up a CNAME file. If your DNS files aren't validating, check to make sure there are no other DNS records that could be a duplication. ### My DNS doesn't accept underscores SendGrid requires underscores for sender authentication, but some DNS providers do not support underscores in zone file entries. If your provider does not allow you to use underscores in zone files, consider changing your DNS hosting provider. You can also disable automated security - this allows you to set up TXT and CX records that don't have underscores. For more information about setting up automated security, see [Using automated security]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/#using-automated-security). ### Manually validating records Sometimes there is no other option but to manually validate your DNS records. This can be caused by certain DNS providers or by customizations you add to your records. *To manually validate you DNS files:* ### Verify Your DNS Records Manually To validate a DNS record manually, use the Unix command `DIG`. These examples use **Terminal** on a Mac platform. These tables show specific validations. If the **ANSWER** section of the dig return is empty, that usually means that either the record does not exist or has yet to propagate. Examples: ### Domains ### Automated Security ON <table class="table"> <tr> <th>Command</th> <th>Type</th> <th>ANSWER</th> </tr> <tr> <td>dig cname sub.domain.com</td> <td>CNAME</td> <td>u123456.wl.sendgrid.net</td> </tr> <tr> <td>dig cname s1._domainkey.sub.domain.com</td> <td>CNAME</td> <td>s1.domainkey.u123456.wl.sendgrid.net</td> </tr> <tr> <td>dig cname s2._domainkey.domain.com</td> <td>CNAME</td> <td>s2.domainkey.u123456.wl.sendgrid.net</td> </tr> </table> ### Automated Security OFF <table class="table"> <tr> <th>Command</th> <th>Type</th> <th>ANSWER</th> </tr> <tr> <td>dig mx sub.domain.com</td> <td>MX</td> <td>mx.sendgrid.net</td> </tr> <tr> <td>dig txt m1._domainkey.sub.domain.com</td> <td>TXT</td> <td>k=rsa; t=s; p=MIGfMA0GC...</td> </tr> <tr> <td>dig txt sub.domainkey.domain.com</td> <td>TXT</td> <td>v=spf1 include:sendgrid.net ~all</td> </tr> </table> ### Email Links <table class="table"> <tr> <th>Command</th> <th>Type</th> <th>ANSWER</th> </tr> <tr> <td>dig cname links.domain.com</td> <td>CNAME</td> <td>sendgrid.net</td> </tr> <tr> <td>dig cname 123456.domain.com</td> <td>CNAME</td> <td>sendgrid.net</td> </tr> </table> ### IPs <table class="table"> <tr> <th>Command</th> <th>Type</th> <th>ANSWER</th> </tr> <tr> <td>dig a o1.default.domain.com</td> <td>A</td> <td>12.34.56.78 (your SendGrid IP address)</td> </tr> </table> You can also use the [DNSLookup](http://mxtoolbox.com/DNSLookup.aspx) tool provided by MxToolbox: enter the record you would like to check, and hit enter. If you can successfully verify your DNS changes manually, but it won't validate in the tool, contact [Support](https://support.sendgrid.com/hc/en-us), and we can help you investigate. ## Where is my domain hosted? If you aren't sure what DNS provider hosts your domain use this command to find out: ``` dig <<your_domain.com>> ns ``` ## Can I authenticate multiple domains? Yes, it’s possible to authenticate multiple domains. When multiple authenticated domains exist on your account, SendGrid will use the from address for each email you send through SendGrid and match it to a domain and branded link. If the from address does not match an existing authenticated domain, SendGrid will fall back to the domain you have chosen as the default. ## Domain authentication application logic Run through the application logic to understand why your sent emails may not be using `SendGrid.net` instead of the domain you authenticated. <call-out> If SendGrid cannot match your email to a valid authenticated domain, `SendGrid.net` is used. </call-out> For any account, SendGrid attaches authenticated domain information in the following order, starting at the top of the list and applying the domain when the criteria are matched: 1. Valid authenticated domain that matches the domain in the FROM address. 2. Valid default authenticated domain. *If no valid authenticated domains can be found, your mail domain defaults to sendgrid.net.* For subusers, SendGrid attaches authenticated domain information in the following order, starting at the top of the list and applying the domain when the criteria are matched: 1. Authenticated domain **for this subuser** that matches the domain in the FROM address. 1. Default authenticated domain **for this subuser**. 1. Authenticated domain assigned by the parent account to this subuser. *If no valid authenticated domains can be found, the sending domain defaults to sendgrid.net.* <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ## Additional resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [How to set up link branding]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) - [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) ================================================ FILE: content/docs/ui/account-and-settings/two-factor-authentication.md ================================================ --- seo: title: Two-Factor Authentication description: Two-Factor Authentication gives you an extra layer of security to protect your SendGrid account. keywords: 2FA, two-factor authentication, authentication, security, authy title: Two-Factor Authentication group: account-management weight: 0 layout: page navigation: show: true --- <iframe src="https://player.vimeo.com/video/248169751" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> Two-factor authentication, commonly referred to as multi-factor authentication, allows you to make your SendGrid account more secure by requiring authentication beyond a simple username and password when logging in. <call-out type="warning"> SendGrid no longer accepts Basic authentication (username and password) for API calls when two-factor authentication is enabled for a user. You can now only use two-factor authentication if you are authenticating with an API key. For more information, see [Authentication]({{root_url}}/for-developers/sending-email/authentication/). </call-out> Twilio SendGrid’s Two-Factor Authentication can be configured to accept a code sent to your mobile phone either via the [Authy App](https://www.authy.com/app/mobile/), or an SMS message. Enabling 2FA does not require an Authy account, but if you have one, you will be able to use either the [Authy App](https://www.authy.com/app/mobile/) or SMS messages. ## Setting Up Two-Factor Authentication Before setting up two-factor authentication, ensure you have access to your account email address. You can do this by visiting your [Account Details](https://app.sendgrid.com/account/details) and reviewing your email address under Your Account > Personal Info. If you need to update your email address, click the pencil icon to update to an email address you can access, send a confirmation email, and visit your inbox to confirm your email address by clicking the link in the email address change confirmation email. Once you have confirmed access to your account email address, you may choose from 2 different verification methods when using two-factor authentication: 1. Generate a verification code with the [Authy App](https://www.authy.com/app/mobile/). The Authy App allows you to authenticate over WiFi if you do not have cellular service and allows you to send your code as an SMS message. If you use Authy, enable the [Authy backup feature](https://authy.com/features/backup/) to help prevent getting locked out of your account. 1. Enter a code sent to your mobile phone that is generated by SendGrid. <call-out type="warning"> When authenticating via SMS message, you must have cellular service, or you will not be able to log into your account. </call-out> *To set up Two-Factor Authentication:* 1. Navigate to **Settings**, and click **Two-Factor Authentication**. <br>From this page, you see an overview of your Two-Factor Authentication settings, along with any settings that you have created for credentialed users. 1. Click **Add Two-Factor Authentication**. 1. Select either the Authy App or text messages (SMS) as your means of authentication. 1. Enter your **country code** and **phone number**. <call-out> Subusers and Teammates need to create their own Two-Factor Authentication settings in their account using the same steps. </call-out> ## Using Two-Factor Authentication After you create a setting for Two-Factor Authentication, log in as you normally would. If you opt to receive a text message with your authentication token, look for the text message and enter the code that you receive. If you have selected the Authy App, go to your app, and enter the generated code. Once set up, you will always be required to use Two-Factor Authentication to perform security-restricted actions in your SendGrid account, such as logging in or changing your Two-Factor Authentication settings. When prompted, enter the 7-digit token sent to your device, or generated by the Authy App. ## Adding Multiple Users To provide secure access to multiple users of your account we recommend adding [Teammates](https://sendgrid.com/docs/ui/account-and-settings/teammates/) and enabling two-factor authentication for each Teammate. If you cannot add Teammates, use the [Multi-device feature on Authy](https://support.authy.com/hc/en-us/articles/360016317013-Enable-or-Disable-Authy-Multi-Device). ## Disabling Two-Factor Authentication *To disable or delete a Two-Factor Authentication setting:* 1. Navigate to **Settings**, and click **Two-Factor Authentication**. 1. Find the setting you would like to delete. 1. Click the **action menu**, and then select **Delete**. 1. Enter the 7 digit code you receive via text or Authy app into the field and then click **Delete**. ## Regaining access to my account after being locked out by Two-Factor Authentication If you find that you’ve lost access to your account as a result of Two-Factor Authentication, please reach out to the [Authy Support Team](https://support.authy.com/hc/en-us). ## Additional Resources * [Restoring Authy access on lost or inaccessible phones](https://support.authy.com/hc/en-us/articles/115012672088-Restoring-Authy-access-on-lost-or-inaccessible-phones) * [The Value of Two-Factor Authentication](https://sendgrid.com/blog/the-value-of-two-factor-authentication/) ================================================ FILE: content/docs/ui/account-and-settings/upgrading-your-account.md ================================================ --- seo: title: Upgrading your Plan description: Upgrading your SendGrid plan keywords: sendgrid account, sendgrid plan, email account, emails per month title: Upgrading your Plan weight: 0 group: account-management layout: page navigation: show: true --- Whether you’re a startup or a large enterprise, SendGrid has several plans tailored to meet your email needs. ## Upgrade your SendGrid plan Before you can upgrade account, you need to complete some verification steps for security purposes. <call-out type="warning"> If you signed up for a Twilio SendGrid account prior to 9/17/2020, skip to the [choose a plan](#choose-a-plan) section of this page. </call-out> _To unlock your Twilio SendGrid account:_ 1. Confirm your email address. If you need to resend the verification email, click **Resend account verification**. If you entered your email address incorrectly in the initial signup form, you can correct the email address and resend the verification email to the correct address. 1. Set up [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). Authenticating your domain shows email providers that Twilio SendGrid has your permission to send emails on your behalf. <call-out> If you don't have access to your domain's DNS records, you can use the **Send To A Coworker** feature. This feature allows you to enter a colleague's email address so Twilio SendGrid can send them all the information they need to complete domain authentication on your behalf. ![Send to a coworker tab]({{root_url}}/img/domain-auth-send-to-coworker.png 'Send to a coworker tab') </call-out> 3. Set up [Two-Factor Authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/) 4. Add a [payment method]({{root_url}}/ui/account-and-settings/billing/#payment-methods). Your card will not be charged at this time. ## SendGrid Plans To learn more about each plan, see our [**features comparison**](https://sendgrid.com/pricing/). If you’d like to speak with a representative about which plan is right for you, feel free to [**contact us**](https://sendgrid.com/contact-us-form/). ### Email API Free Plan - 100 emails per day. ### Marketing Campaigns Free Plan Send to up to 2,000 contacts and 6,000 Emails per month and test all the features of Marketing Campaigns, including Automation. <call-out> **Dedicated IP with Email API Pro and Premier and Marketing Campaigns Advanced Plans** Take control of your sending reputation and deliverability with a dedicated IP address, provided with every Pro, Premier and Advanced plan. [Learn More](https://sendgrid.com/blog/shared-and-dedicated-ips-which-should-you-choose/). </call-out> ### Choose a plan _Email API_ 1. Decide the plan you upgrade to by reviewing features and comparing your current email send volume to the available plans [here](https://sendgrid.com/pricing). 1. Navigate to your [**Account Details**](https://app.sendgrid.com/account/products) page, and then click on the **Your Products** tab. 1. Under **Email API**, select **Change Plan**. 1. Find the plan you would like to upgrade to and then click **Select**. 1. Add your payment information in the popup window and then click **Submit**. <call-out type="warning"> You will not be able to upgrade you account until you complete the verification steps listed above. </call-out> _Marketing Campaigns_ 1. Decide the plan you upgrade to by comparing your current contact storage usage and email sends to the available plans [here](https://sendgrid.com/pricing). 1. Navigate to your [**Account Details**](https://app.sendgrid.com/account/products) page, and then click on the **Your Products** tab. 1. Under **Marketing Campaigns**, select **Change Plan**. 1. Find the plan you would like to upgrade to and then click **Select**. 1. Add your payment information in the popup window and then click **Submit**. <call-out type="warning"> You will not be able to upgrade you account until you complete the verification steps listed above. </call-out> ================================================ FILE: content/docs/ui/account-and-settings/verifying-your-account.md ================================================ --- layout: page weight: 0 group: account-management title: Verifying your Account seo: title: Verifying your Account description: Signed up with SendGrid? Learn more about the steps to complete first... keywords: sign, up, signup, account, verification, 2fa, mfa, two, factor, authentication, auth, getting, started, paid, credits, unlock, verify, 100 navigation: show: true --- When you sign up for a SendGrid account, there are a few steps that our users must complete before they can start using their accounts fully. Once you complete the steps presented, your credit usage limits will be unlocked. We require these steps for your security, as well as to help you get started more quickly! ## Access your Upgrade Options The time it takes to completely unlock your account can vary based on how quickly you complete the required steps. The faster you complete the steps, the faster you can start sending! ### Unlock your Free Account In order to send email with your free Twilio SendGrid account, you must create and verify a Single Sender. Adding a Sender Identity will help protect your sending reputation and legitimize your account in the eyes of the inbox providers for better deliverability. For more information, see [Single Sender Verification]({{root_url}}/ui/sending-email/sender-verification/). ### Upgrading your Account 1. Confirm your email address. If you need to resend the verification email, click **Resend account verification**. If you entered your email address incorrectly in the initial signup form, you can correct the email address and resend the verification email to the correct address. 2. Set up [Domain Authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/). Authenticating your domain shows email providers that Twilio SendGrid has your permission to send emails on your behalf. <call-out> If you don't have access to your domain's DNS records, you can use the **Send To A Coworker** feature. This feature allows you to enter a colleague's email address so Twilio SendGrid can send them all the information they need to complete domain authentication on your behalf. ![Send to a coworker tab]({{root_url}}/img/domain-auth-send-to-coworker.png 'Send to a coworker tab') </call-out> 3. Set up [two-factor authentication]({{root_url}}/ui/account-and-settings/two-factor-authentication/#setting-up-two-factor-authentication). Two-factor authentication allows you to make your SendGrid account more secure by requiring authentication beyond a simple username and password when logging in. 4. Add a [payment method]({{root_url}}/ui/account-and-settings/billing/#payment-methods). Your card will not be charged at this time. You will need to complete all of these steps to completely verify your account. You cannot skip any of the verification steps, or your account won't be unlocked. <call-out type="warning"> In some instances our compliance team will need to manually verify your account information before you can start sending. In these cases your account should be unlocked within 72 hours of completing the last account verification step. </call-out> ================================================ FILE: content/docs/ui/analytics-and-reporting/browser-comparison.md ================================================ --- seo: title: Browser Comparison Statistics description: Compare your Browser specific email statistics. keywords: Browser comparison statistics, Compare SendGrid Browser statistics title: Browser Comparison Statistics weight: 0 group: statistics layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> Browser information can help optimize your email sending by showing you how different browser usage affects how your recipients interact with your email. As a result, you may want to compare one browser’s statistics to another to see differences or to see if a recent change has made an improvement. The browser comparison tool allows you to do this. You can change the metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Comparison Overview Your top most graph will show you how each selected browser has fared for the selected individual metric in the donut graph. ## Individual Metrics Comparison This graph will show you the browser statistics for the selected metric. To change the metric, select it from the button at the top of the page. You can remove individual browsers from the graph by clicking the button above and to the right of this chart and unchecking the boxes next to the browser name. The graph will refresh, showing only the statistics for the selected browser. ## Individual Metrics Figures This table is titled “Figures for Delivered” and shows you the actual delivery numbers over time for each of the compared browsers. You can also choose to show actual counts or percentages by clicking the corresponding button above and to the right of the table. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ## Additional Resources - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Subusers]({{root_url}}/ui/analytics-and-reporting/subusers/) - [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/) ================================================ FILE: content/docs/ui/analytics-and-reporting/browser.md ================================================ --- seo: title: Browser Statistics description: View and filter your Browser specific email statistics. keywords: Browser statistics, SendGrid Browser statistics title: Browser Statistics weight: 0 group: statistics layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> The browser statistics report which browsers (such as Safari, Firefox, and Chrome) your recipients use to view your email. <call-out> There are similarities between Device and Browser statistics and we are working on ways to consolidate the data. The current reasoning for 2 separate reports is that in some cases an open from a device can result with a click from a browser that represents the device (e.g. Open on an Iphone -> Click on an Iphone), in other cases an open from one device can result in a click from a different browser (e.g. an Open on a desktop computer -> Click on FireFox). </call-out> Choose a browser from the list to see statistics about how your recipients interact with your email based on the application they use to look at the internet. The actual statistics included vary depending upon [your account settings]({{root_url}}/ui/account-and-settings/account/). Emails sent, bounces, and spam reports will always get tracked. Unsubscribes, clicks, and opens require that the associated settings are enabled. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Figures The figures table gives you all of the specific counts or percentages of each event according to how you’ve grouped your statistics (day, week, or month). For example, if you wanted to see what percentage of the emails you sent were actually opened on the second week of April based on the browser, this is a great place to look. This table will refresh with new or adjusted data based on the various filters available at the top of the page. You can also choose to show actual counts or percentages by clicking the corresponding button above and to the right of the table. .<call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Account Settings]({{root_url}}/ui/account-and-settings/account/) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Browser Comparison]({{root_url}}/ui/analytics-and-reporting/browser-comparison/) ================================================ FILE: content/docs/ui/analytics-and-reporting/categories.md ================================================ --- seo: title: Category Statistics description: View and filter your Category specific SendGrid email statistics. keywords: category statistics, SendGrid category statistics title: Category Statistics group: statistics weight: 0 layout: page navigation: show: true --- <call-out type="warning"> This information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> <call-out> Category statistics are available for the previous thirteen months only. </call-out> Categories can help organize your email analytics by enabling you to “tag” emails by type. Just as you can view the statistics on all your [email activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/), you can go a step further and view the statistics broken down to a particular category. The actual statistics included vary depending upon your [account settings]({{root_url}}/ui/account-and-settings/account/). Emails sent, bounces, and spam reports will always get tracked. Unsubscribes, clicks, and opens require that the associated settings are enabled. In order to see statistics for a category, select the category and the page will show you both a graph and a table of your category’s email statistics. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Figures The figures table gives you all of the specific counts or percentages of each event, according to how you’ve grouped your statistics (day, week, or month). For example, if you wanted to see what percentage of the emails you sent were actually opened on the second week of April, this is a great place to check. This table will refresh with new or adjusted data based on the various filters available at the top of the page. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. ## Using the API [Using Categories with the SMTP API]({{root_url}}/for-developers/sending-email/categories/) <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Account Settings]({{root_url}}/ui/account-and-settings/account/) ================================================ FILE: content/docs/ui/analytics-and-reporting/category-comparison.md ================================================ --- seo: title: Category Statistics Comparison description: Compare your email category statistics. SendGrid's simplified, real-time analytics allows you to compare up to 10 email categories to measure results. keywords: compare category statistics, SendGrid compare category statistics, category statistic comparison title: Category Comparison Statistics group: statistics weight: 0 layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Categories can help organize your email analytics by enabling you to “tag” emails by type. As a result, you may want to compare one category to another. The category comparison tool allows you to do this. ## Select Your Categories You can compare up to 10 categories at a time. To select them, click the **+** sign next to each category name in the left-side list. Then, click **Compare**. ## Comparison Overview Once you have selected the categories, your top most graph will show you how each selected category has fared for each individual metric in a single graph. Each category will be assigned a color in this bar chart. You can remove individual categories from the list of categories you selected initially, by clicking **Categories** and unchecking categories. The graph will refresh, showing only the selected categories. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Individual Metrics Comparison When you initially choose the categories to compare, this graph will be titled “Comparison for Deliveries” and will show you the delivery rates over time for each of the compared categories. You can remove individual categories from the list of categories you selected initially, by clicking **Categories** and unchecking categories. The graph will refresh, showing only the selected categories. To change this graph to see another metric for your categories, click the button next to the Categories button and choose another metric. ## Individual Metrics Figures When you initially choose the categories to compare, this table will be titled “Figures for Delivered” and will show you the actual delivery numbers over time for each of the compared categories. You can remove individual categories from the list of categories you selected initially, by clicking **Categories** and unchecking categories. The graph will refresh, showing only the selected categories. To change this graph to see another metric, click the button inline with the graph title and choose another metric. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Subusers]({{root_url}}/ui/account-and-settings/subusers/) - [Using Categories with the SMTP API]({{root_url}}/for-developers/sending-email/categories/) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) ================================================ FILE: content/docs/ui/analytics-and-reporting/click-tracking-html-best-practices.md ================================================ --- seo: title: Click Tracking & HTML Best Practices description: Click Tracking & HTML Best Practices keywords: a href, /wf/, cname, <a>, http, https, click, html, click_tracking title: Click Tracking & HTML Best Practices group: click-tracking weight: 0 layout: page zendesk_id: 200181448 navigation: show: true --- If you are experiencing issues with the click tracking setting not replacing your original links, please take a look at your link formatting. Links must be in the proper format in order for our click tracking setting to find and replace them: Links must be within an HTML `<a>` tag with the `href` argument within the tag. There must not be spaces around the `=` in the `href` attribute, the URI must be quoted, and must be preceded by **`"http://`** or **`"https://`**. Here are some example links that will be properly replaced by our click tracking app: `<a href="http://www.sendgrid.com">SendGrid</a>` `<a href="https://sendgrid.com">SendGrid</a>` `<a target="_blank" href="https://sendgrid.com">SendGrid</a>` Note that a link shouldn’t be a custom field or buried within a custom field. For example: `<a href="{{ birthday_url }}"></a>` will not work. Instead you should format your link like this: `<a href="http://yoursite.com/{{ birthday_url }}"></a>` {{ user_profile_blurb }} resolves to The quick brown <a href="http://google.com">fox</a> jumps over the lazy dog will also not work. The following links, even though they may still resolve, will not be captured or replaced by our click tracking system: `<a href="sendgrid.com">SendGrid</a>` `<a href="www.sendgrid.com">SendGrid</a>` `<a href= http://www.sendgrid.com>SendGrid</a>` `<a href = "https://sendgrid.com">SendGrid</a>` <call-out> If you are in the habit of BASE64 encoding your email content, we will be unable to detect the encoded `<a>` tags and overwrite them, so clicks will not be tracked in this case. </call-out> Click tracking can be turned off for individual links by including the `clicktracking=off` attribute inside the anchor of an HTML link *before* the `href`. For example, `<a clicktracking=off href="http://example.com">link text</a>` would not be tracked. If you have a Pro 100K package or higher and you have [authenticated]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/) your sending IP address, the replaced click tracking links lie under the authenticated subdomain. Pro 100K and higher packages that have not authenticated, Essentials packages, and Free packages have click tracking links that resolve through one of SendGrid's domains (sendgrid.net, sendgrid.info, sendgrid.me, etc.). ================================================ FILE: content/docs/ui/analytics-and-reporting/click-tracking-ssl.md ================================================ --- seo: title: Setting up SSL for click tracking title: Setting up SSL for click tracking group: click-tracking layout: page weight: 0 navigation: show: true --- ## Overview SendGrid supports SSL enabled click and open tracking. This feature is enabled automatically if you are using a shared IP address or have a non-authenticated domain. To enable SSL click and open tracking for an authenticated domain, additional configuration for SSL keys is required. ## Configuring SSL Certificates and Keys In order for click and open tracking to work over SSL, SendGrid needs to present a valid certificate that will be trusted by the email recipient's browser. For authenticated domains, SendGrid is not able to request and/or manage certificates, as it is not the record owner for the domain. To work around this restriction, you may use a CDN service, such as [CloudFlare]({{root_url}}/ui/sending-email/content-delivery-networks/#using-cloudflare), [Fastly]({{root_url}}/ui/sending-email/content-delivery-networks/#using-fastly), or [KeyCDN]({{root_url}}/ui/sending-email/content-delivery-networks/#using-keycdn) to manage certificates and keys for your domain. You can also setup [custom SSL configuration]({{root_url}}/ui/account-and-settings/custom-ssl-configurations/). These services can then forward traffic onwards to SendGrid so that click and open tracking can be performed. Once you have followed the configuration guide for either of these services, please [contact support](https://support.sendgrid.com/hc/en-us) and they will enable SSL click and opening tracking for you. ================================================ FILE: content/docs/ui/analytics-and-reporting/device.md ================================================ --- seo: title: Device Statistics description: View and filter your device specific email statistics. keywords: Device statistics, SendGrid device statistics title: Device Statistics group: statistics weight: 0 layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> The clients report breaks down which devices and clients are most frequently used to open the mail you send. The devices and types that SendGrid tracks are: <table class="table table-striped"> <tr> <th>Device</th> <th>Description</th> </tr> <tr> <td>Desktop</td> <td>Email software on desktop computer I.E. Outlook, Sparrow, or Apple Mail.</td> </tr> <tr> <td>Webmail</td> <td>A web-based email client (Yahoo, Google, AOL, Outlook.com, etc.).</td> </tr> <tr> <td>Phone</td> <td>A smart phone (iPhone, Android, Blackberry, etc.).</td> </tr> <tr> <td>Tablet</td> <td>A tablet computer (iPad, android based tablet, etc.).</td> </tr> <tr> <td>Other</td> <td>An unrecognized device.</td> </tr> </table> ## Top 5 The top 5 section will show you the most engaged email clients and devices based on the selected metric. By default, clicks are selected, but you can change that by choosing a metric from the button at the top of this section. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Individual Metrics Activity Based on the selected devices and metric at the top of this page, this graph will refresh. You can see how your recipients engage with your emails by device type over time. You can remove individual device types from the list at the top of the page. This will affect all the data on this page. To change this graph to see another metric for your recipient’s devices, choose the metric from the button at the top of this page. ## Individual Metrics Figures When you initially choose the devices to compare, this graph will show you the actual open numbers over time for each of the compared devices. You can remove individual devices from the list of devices at the top of this page. The graph will refresh, showing only the selected subusers. You can also choose to show actual counts or percentages by clicking the corresponding button above and to the right of the table. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Subusers]({{root_url}}/ui/account-and-settings/subusers/) ================================================ FILE: content/docs/ui/analytics-and-reporting/email-activity-feed.md ================================================ --- layout: page weight: title: Email Activity Feed group: email-activity navigation: show: true seo: title: Email Activity Feed override: true description: --- <call-out> Higher volume users may not have access to the new Email Activity Feed yet. For information about the legacy Email Activity Feed, see [Legacy Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity/). </call-out> <iframe src="https://player.vimeo.com/video/259928139" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> The Email Activity Feed allows you to view a snapshot of recent email-related activity events associated with your account and any subusers. It makes the delivery flow of each message visible, which expedites troubleshooting. The additional Email Activity history add-on extends event access up to 30 days. With the Email Activity feed you can: * Troubleshoot email delivery issues faster with comprehensive and sequential event data by email message. * Pinpoint specific emails easily with advanced search and filter options--including subject line and email metadata. * Customize your data independently with the CSV download/export option. * View up to 30 days of history when you purchase an upgrade. * Call all events by an email message from the API when you purchase additional storage. <call-out> Reseller accounts and extra high volume accounts do not have access to the new Email Activity Feed. For information about the legacy Email Activity Feed, see [Legacy Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity/) </call-out> ## Types of email activity data The Email Activity Feed allows you to view specific information about messages sent from your account. <table class="table" style="table-layout:fixed"> <tr> <th >Event</th> <th >Description</th> </tr> <tr> <td>Processed</td> <td>Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.</td> </tr> <tr> <td>Clicks</td> <td>Whenever a recipient clicks one of the Click Tracked links in your email. In the Email History, SendGrid displays the date, time, and the URL for the link that was clicked.</td> </tr> <tr> <td>Delivered</td> <td>The accepted response generated by the recipients' mail server.</td> </tr> <tr> <td>Opens</td> <td>The response generated by a recipient opening an email.</td> </tr> <tr> <td>Unsubscribes</td> <td>Whenever a recipient unsubscribes from your emails. </td> </tr> <tr> <td>Group Unsubscribes</td> <td>Whenever a recipient unsubscribes from a suppression group.</td> </tr> <tr> <td>Group Resubscribes</td> <td>When a recipient resubscribes themselves to a suppression group.</td> </tr> <tr> <td>Deferred</td> <td>The recipient mail server asked SendGrid to stop sending emails so fast.</td> </tr> <tr> <td>Drops</td> <td>SendGrid will drop an email when the contact on that email is in one of your suppression groups, the recipient email previously bounced, or that recipient has marked your email as spam.</td> </tr> <tr> <td>Bounces </td> <td>The receiving server could not or would not accept the message. If a recipient has previously unsubscribed from your emails, your attempt to send to them is bounced.</td> </tr> <tr> <td>Blocks</td> <td>When your IP address has been blocked by an ISP or messaging organization. Blocks are less severe than bounces and do not result in permanent suppressions: subsequent sends to blocked email addresses are not automatically suppressed.</td> </tr> <tr> <td>Spam Reports</td> <td>Whenever a recipient marks your email as spam and their mail server tells us about it.</td> </tr> </table> <call-out type="warning"> Parse events are not available within the Activity Feed. Please utilize your parse endpoint to determine whether or not these events are posting properly. </call-out> ## Filtering email activity The Email Activity Feed lists each email sent. Click on each email to view the current list of triggered events for that email. Use our basic or advanced search to filter by email subject, recipients, or event types. ## Basic search The email address field filters with an approximate, or fuzzy, search. The date field filters events within the specified date range. <call-out> To filter by event type, like in the legacy Email Activity Feed, use [Advanced search](#advanced-search), select Event Type, and choose an event type to filter by. </call-out> ## Advanced Search In addition to viewing the email activity associated with your account by recipient email address, domain, or event date, you can also use the following filters to sort your data: * API Key ID * API Key Name * Campaign ID * Campaign Name * Categories * Date Processed * Event Type (Bounced, Clicked, etc.) * From Email Address * Message ID * Number of Clicks * Number of Opens * Requesting IP Address * Sending IP Address * Status (Delivered, Not Delivered, Processing) * Subject Line * Teammate * To Email Address * Transactional Template ID * Transactional Template Name * Unsubscribe Group ID * Unsubscribe Group Name *To use advanced search:* 1. At the top of the Activity Feed page, click **Advanced** search. 1. In the field on the far left, select the criteria to filter your event data. 1. Once you have filled in all of the fields associated with that filter, click **Search**. To add additional search criteria, click **Add a Filter**. ![]({{root_url}}/img/EASE_advanced_search_filter.gif "Email Activity Advanced Search") *To further narrow your search results:* * Search emails by **any** of the following - This search will return more results and will pull in all events that meet *one or more* of the criterion specified by the selected filters. * Search emails by **all** of the following - This search will return fewer results and will pull in events that meet *every* criteria specified by the selected filters. ## Viewing event history *To view event history:* 1. Navigate to the event you wish to view, and click on the entry. Once the entry loads, you can click into each of the sections to view more details of each email message. 1. When you have finished reviewing the data, click **Close**. ![]({{root_url}}/img/EASE_email_information.gif "Email Activity information panel") ## Exporting a CSV *To export a CSV:* 1. In the top right corner of the activity feed, click **Export CSV**. This triggers an email to the email address associated with your SendGrid account. 1. Open the email and then click **Download**. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Email Activity API](https://sendgrid.api-docs.io/v3.0/email-activity/filter-all-messages) - [Legacy Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity/) - [Getting Started with the Email Activity API]({{root_url}}/for-developers/sending-email/getting-started-email-activity-api/) - [Building compound Email Activity queries]({{root_url}}/for-developers/sending-email/getting-started-email-activity-api/#creating-compound-queries) ================================================ FILE: content/docs/ui/analytics-and-reporting/email-activity.md ================================================ --- layout: page weight: 0 title: Legacy Email Activity group: email-activity seo: title: SendGrid Legacy Email Activity description: Email activity allows you to see and search the email events on your account. keywords: email activity, account events, email events, old email activity navigation: show: true --- <call-out type="warning"> If you are looking for the new Email Activity documentation, please go [here]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/). </call-out> <iframe src="https://player.vimeo.com/video/130900679" width="500" height="312" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> The Email Activity feed allows you to view a snapshot of email-related activity associated with your account. These logs display all of your email events - filter by event type or search by email address. <call-out> Email activity shows the most recent 500 events. To access data in real time, implement our Event Webhook. </call-out> ## Filtering the Activity Feed *To filter by event type:* 1. On the [Email Activity page](https://app.sendgrid.com/email_activity), in the filter drop down, click the checkbox next to “All Filters”. 1. Select individual event types to filter. </br>The activity feed refreshes with the event types you selected. ## Searching the Activity Feed *To search the Activity feed by email, mailbox name or domain name:* - To search by email, enter the recipient’s entire email address into the search field and click enter. - To search by mailbox name (the part of an email before the @ symbol), enter the mailbox name into the search field and click enter. - To search by domain name (the part of an email after the @ symbol), enter the domain into the search field and click enter. ## Subuser email activity To see a subuser’s email activity, log in as that subuser or [impersonate]({{root_url}}/ui/account-and-settings/subusers/#impersonating-a-subuser) the subuser account. You cannot see a parent accounts email activity from a subuser account. ## Email Events The Email Activity feed allows you to view specific information about messages sent from your account. <table class="table" style="table-layout:fixed"> <tr> <th>Event</th> <th>Description</th> </tr> <tr> <td>Processed</td> <td>Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.</td> </tr> <tr> <td>Clicks</td> <td>Whenever a recipient clicks one of the Click Tracked links in your email.</td> </tr> <tr> <td>Delivered</td> <td>The accepted response generated by the recipients' mail server.</td> </tr> <tr> <td>Opens</td> <td>The response generated by a recipient opening an email.</td> </tr> <tr> <td>Unsubscribes</td> <td>Whenever a recipient unsubscribes from your emails. </td> </tr> <tr> <td>Group Unsubscribes</td> <td>Whenever a recipient unsubscribes from a suppression group.</td> </tr> <tr> <td>Group Resubscribes</td> <td>When a recipient resubscribes themselves to a suppression group.</td> </tr> <tr> <td>Deferred</td> <td>The recipient mail server asked SendGrid to stop sending emails so fast.</td> </tr> <tr> <td>Drops</td> <td>SendGrid will drop an email when the contact on that email is in one of your suppression groups, the recipient email previously bounced, or that recipient has marked your email as spam.</td> </tr> <tr> <td>Bounces </td> <td>The receiving server could not or would not accept the message. If a recipient has previously unsubscribed from your emails, your attempt to send to them is bounced.</td> </tr> <tr> <td>Blocks</td> <td>When your IP address has been blocked by an ISP or messaging organization. Blocks are less severe than bounces and do not result in permanent suppressions: subsequent sends to blocked email addresses are not automatically suppressed.</td> </tr> <tr> <td>Spam Reports</td> <td>Whenever a recipient marks your email as spam and their mail server tells us about it.</td> </tr> <tr> <td>Parse</td> <td>Triggered if you're using the Inbound Parse Webhook.</td> </tr> </table> ## Troubleshooting ### Checking delivery status of a specific email You can check email delivery status by using the Email Activity page, or by using the Event Webhook. - For a successful delivery, the Email Activity page, or the Event Webhook shows a delivered event - expanding it shows a reason code of 250 OK. This means the receiving server has accepted the message. You can also check bounced, deferred, and processed messages. - If you can't find an email on the Email Activity page, check your suppression lists; [bounces]({{root_url}}/ui/sending-email/bounces/), [blocks]({{root_url}}/ui/sending-email/blocks/), [spam reports]({{root_url}}/ui/analytics-and-reporting/spam-reports/), [invalid email]({{root_url}}/ui/sending-email/invalid-emails/). - Have the recipient check their spam folder. ### Deferrals In your logs, you may see the following error message accompanying a deferral event: `Email was deferred due to the following reason(s): ["IPs reached ISP-suggested hourly limits" http://send.gd/1uKnEBh]` This deferral means you've been going over IP warmup limits on a new IP. For more information about IP Warmup, see [Warming up an IP Address]({{root_url}}/ui/sending-email/warming-up-an-ip-address/). In your logs, you may see the following error message accompanying a deferral event: `Email was deferred due to the following reason(s): ["IPs reached ISP-suggested max connection limits: http://send.gd/1uKnEBh"]` This deferral is created by SendGrid to control the rate of delivery by ISP to help prevent throttling and spam folder delivery. Sending too much mail too fast can cause different mail providers to be suspicious of the mail, and that impacts deliverability. This automatic deferral was put in place to allow senders to send as much mail as you want at once, without impacting your deliverability. ### Drops A drop occurs when you try to send a message to an email address listed on one of the suppression lists: Bounces, Unsubscribes, Spam reports and Invalid Emails. If an email is already on one of the lists, our systems automatically drop the email to protect your Sender Reputation. A dropped message cannot be resent automatically. To resend a message, first [remove the email from the suppression list](#removing-an-email-from-a-suppression-list), and then recreate and resend the email. ### Bounces A bounce is a Drop event that occurs when a message to an address has previously Bounced. You can visit the [Bounces list](https://app.sendgrid.com/suppressions/bounces) under the Suppressions tab, and search the address to find the details of the original attempt, such as the date and full error reason code. Once an address is on this list, we do not attempt to deliver further messages to it; we drop the message to protect your external reputation. A bounced message cannot be resent automatically. To resend a message, first [remove the email from the suppression list](#removing-an-email-from-a-suppression-list), and then recreate and resend the email. <call-out> A delayed bounce occurs when a recipient server accepts a message (Delivered) and then is promptly declined (Bounced). This is an infrequent occurrence, and SendGrid treats these messages as a bounce, and any future sends to this address are dropped, unless you remove the email from your bounce suppression list. </call-out> ### Removing an email from a suppression list SendGrid automatically drops emails sent to addresses on suppression lists. If you want to retry sending an email to an address that is on a suppressions list, you need to remove it from the list first. <call-out type="warning"> Only remove emails from these lists if you're sure the recipients want to receive the email. Otherwise, continuously sending to recipients who don't want your emails can negatively impact your sender reputation. </call-out> *To remove an email from a suppression list:* 1. In the UI, under [Suppressions](https://app.sendgrid.com/suppressions/global_unsubscribes), navigate to the suppression list that you want to remove a recipient from: [Global Unsubscribes](https://app.sendgrid.com/suppressions/global_unsubscribes), [Group Unsubscribes](https://app.sendgrid.com/suppressions/group_unsubscribes), [Bounces](https://app.sendgrid.com/suppressions/bounces), [Spam Reports](https://app.sendgrid.com/suppressions/spam_reports?), [Blocks](https://app.sendgrid.com/suppressions/blocks?), or [Invalid](https://app.sendgrid.com/suppressions/invalid_emails?). 1. Select the email you want to remove. 1. In the drop-down menu on the top right of the screen, select **Remove selected emails**. ### Setting up bounce forwarding You can receive bounce notifications to a specific address by enabling the "Forward Bounces" feature in your account and defining the forwarding address. However, you can also set it to send any bounces back to the originating FROM address. **To receive a bounce notification report to the FROM address on the email that bounced:** 1. Navigate to **[Mail Settings](https://app.sendgrid.com/settings/mail_settings)** and select **Forward Bounce**. 1. Toggle the slider to **on** 1. Leave the "Use the from address" box ticked. 1. Leave the **email address** entry field blank. <call-out> If you are sending bounce messages to a Gmail account, you need to set up an email filter in your inbox to tell Gmail not to send these messages to your spam folder. When Gmail doesn’t see a corresponding message in the sent folder connecting the bounce message, it may decide that the bounce message isn’t valid and send it to spam. One way to do this is in the filter, set up **From** `daemon` and **Has the words** `daemon`, and check the box **Never send it to Spam**. </call-out> These are some common issues people see with reading their email activity feed. ================================================ FILE: content/docs/ui/analytics-and-reporting/geographic.md ================================================ --- seo: title: Geographic Statistics description: View and compare your geographic location specific email statistics. keywords: Geographic statistics, SendGrid geographic statistics title: Geographic Statistics group: statistics weight: 0 layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> The geographical report shows a map of where your emails are being opened and clicked around the world. It is based purely on where your users live. For example, if you don’t have any recipients engaging with your emails in France, you will not see statistics for France in your stats. ## Top 5 The top 5 section will show you the most engaged geographical areas based on the selected metric. By default, clicks are selected, but you can change that by choosing a metric from the button at the top of this section. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Activity Map The activity map gives you a visualization of your metric based statistics on an actual map. From the world view, you can click a country to see more specific geographic locations. ## Figures by Location The figures table gives you all of the specific counts or percentages of each event, according to how you’ve grouped your statistics (day, week, or month). For example, if you wanted to see what percentage of the emails you sent were actually opened on the second week of April in California, this is a great place to check. This table will refresh with new or adjusted data based on the various filters available at the top of the page. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. To see only the figures from a specific geographic area, change the Activity Map to be either the world view or a specific country, then select the countries or states you want to see in the figures table using the buttons just above and to the right of the figures data. <call-out> Want deeper data and insights? With [SendGrid Expert Insights]({{root_url}}/ui/analytics-and-reporting/subscribing-to-expert-insights/), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Global Stats](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics) - [Timezones]({{root_url}}/glossary/timezone/) ================================================ FILE: content/docs/ui/analytics-and-reporting/global.md ================================================ --- seo: title: Global Statistics description: View and filter your global SendGrid statistics for your entire account. keywords: Global SendGrid Statistics, SendGrid Global Statistics title: Global Statistics group: statistics weight: 0 layout: page navigation: show: true --- <call-out> Global statistics shown are not an aggregate total for parent accounts and subusers. The statistics outlined will only contain data for whichever account you are currently accessing. Subuser statistics can, however, be accessed from the Parent account's Stats menu either on an individual basis or by comparing multiple subusers. </call-out> Your Global Statistics page is where you can really dig into your email statistics. From here you will be able to filter through your statistics by type, and you will also be able to look at the actual numbers for each stat by date. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Figures The figures table gives you all of the specific counts or percentages of each event according to how you’ve grouped your statistics (day, week, or month). For example, if you wanted to see what percentage of the emails you sent were actually opened on the 2nd week of April, this is a great place to check. This table will refresh with new or adjusted data based on the various filters available at the top of the page. You can also choose to show actual counts or percentages by clicking the corresponding button above and to the right of the table. <call-out> Want deeper data and insights? With [SendGrid Expert Insights Reports]({{root_url}}/ui/analytics-and-reporting/subscribing-to-expert-insights), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Global Statistics](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics) - [Timezones]({{root_url}}/glossary/timezone/) ================================================ FILE: content/docs/ui/analytics-and-reporting/google-analytics.md ================================================ --- seo: title: Google Analytics and SendGrid Statistics description: Google Analytics Demystified: GA Statistics vs SG Statistics keywords: statistics, page, tracking, URL, google, analytics, GA, stats, events, view, UTM title: Google Analytics and SendGrid Statistics group: statistics weight: 0 layout: page zendesk_id: 200181468 navigation: show: true --- SendGrid's [Google Analytics Tracking ](https://app.sendgrid.com/settings/tracking)appends links to integrate with Google Analytics. [Google Analytics](http://support.google.com/analytics/?hl=en) is a great tool for tracking how people get to your site and what they do there. This article describes differences in the results and terminology of both. In general what they track and what terms they use are different than what we do, so we thought it would be helpful to provide the following equivalencies. Google Analytics has Clicks, Visits, Visitors, Pageviews, and Unique Pageviews. SendGrid has Clicks and Opens, as well as all of our [Statistics]({{root_url}}/ui/analytics-and-reporting/stats-overview/). The key here is that Google Analytics Clicks **are in no way related** to SendGrid Clicks. Google Analytics **Visits** should generally correlate to SendGrid **Unique Clicks**. However: - If you link to a non-GA tracked site, there will be more Clicks than Visits. - If a user clicks a link in an email multiple times within the 30 minute Analytics "session" window, there will be a Click for every time they clicked, but only one Unique Click and one Visit. - If have links to multiple GA-tracked sites in a single email, you'll have a Visit logged in each, but only one Unique Click. Unique Clicks are tracked per message, not per link in the message. - If a recipient forwards a message, or revisits your site after 30 minutes, you'll have more Visits than Unique Clicks, though there will be a Click for each. Currently, we cannot differentiate when a message has been forwarded, so there's only one Unique Click. A few scenarios: - You link to your Facebook profile in your email. A recipient clicks the link, which will result in 1 SG **Click** , but no GA **Visits**. - A recipient clicks a link in your message, forwards it to their friend who also clicks a link, or they re-open it in a new browser/device. This will log 1 **Unique Click** , 2 **Clicks** , 2 **Visitors** , and 2 **Visits**. - A recipient clicks a link in your message, comes back an hour later, and clicks the same or a different link in the message to get back to your site. This will log 1 **Unique Click** , 2 **Clicks** , 1 **Visitor** , and 2 **Visits**. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ================================================ FILE: content/docs/ui/analytics-and-reporting/interpreting-expert-insights.md ================================================ --- layout: page weight: 0 title: Interpreting Expert Insights group: expert-insights seo: title: Interpreting Expert Insights description: Learn how to interpret your Expert Insights report keywords: navigation: show: true --- The Expert Insights report contains delivery and engagement metrics from email sent through SendGrid. The report is divided into four sections: * At a Glance * Sent * Delivered * Opened and Clicked <call-out> When you subscribe to Expert Insights, you get access to email strategies and best practices curated by our experts, including step-by-step instructions for how to resolve issues highlighted in the report. </call-out> ## What data is being used to generate the Expert Insights Report In the Expert Insights report, we primarily use unique rates instead of raw numbers. We report the percentage of unique messages that were clicked or opened instead of dividing the number of opens or clicks by the number of messages. This is done to avoid double counting multiple opens or clicks of the same message. For example, if someone takes a link you included in your email and posts it on Twitter where it is clicked thousands of times, it will look like your open or click rate is much higher than 100% and it will skew your understanding of your actual open and click rate. You might notice that the data in these reports differ from data that you see in SendGrid’s user interface (UI). That’s because, in these reports, we look at what was sent during the reporting period and what happened to those specific campaigns. Our UI displays activity statistics by date and not by message so that senders have a snapshot of the performance of all campaigns in a given time frame. <call-out> For privacy reasons, your first Expert Insights report will cover 37 days of data, or as much time as you’ve been a SendGrid customer. Areas of the report that look back past 37 days will be populated over time. </call-out> ## What does the color coding mean In order to make the report as digestible as possible, we have coded your data using the following grading scale: <table> <tr> <th>Color </th> <th>Description</th> </tr> <tr> <td>Green</td> <td>Indicates that a metric has stayed approximately the same or improved slightly since the last report and no changes are needed.</td> </tr> <tr> <td>Yellow</td> <td>Indicates that a metric has decreased slightly since the last report so you should monitor its performance and make suggested changes.</td> </tr> <tr> <td>Red</td> <td>Indicates that a metric has decreased significantly enough since the last report to warrant your attention and changes are strongly recommended.</td> </tr> <tr> <td>Gray</td> <td>Neutral.</td> </tr> </table> Each segment of your report has its own thresholds. See table below for specific thresholds. **Threshold per segment in report** <table> <tr> <th>Element of Report </th> <th>Green</th> <th>Yellow</th> <th>Red</th> <th>Neutral</th> </tr> <tr> <td>Email Funnel - Sent</td> <td>---</td> <td>---</td> <td>---</td> <td>Always Neutral</td> </tr> <tr> <td>Email Funnel - Delivered</td> <td>>,= 98%</td> <td>95% - 98%</td> <td><,= 95%</td> <td>---</td> </tr> <tr> <td>Email Funnel - Delivered % Change</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Email Funnel - Opened</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Email Funnel - Clicked</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>MSP Performance</td> <td>---</td> <td>95% - 98% [98 Not inclusive]</td> <td><,= 95%</td> <td>---</td> </tr> <tr> <td>MSP Variance - Delivered % Change</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>MSP Variance - Opened</td> <td>>0%</td> <td>0% - 50% Decrease</td> <td>>,= 50% Decrease</td> <td>0%</td> </tr> <tr> <td>MSP Variance - Clicked</td> <td>>0%</td> <td>0% - 70% Decrease</td> <td>>,= 70% Decrease</td> <td>0%</td> </tr> <tr> <td>Category - Sent (30 Days)</td> <td>---</td> <td>---</td> <td>---</td> <td>Always Neutral</td> </tr> <tr> <td>Category - Delivered (30 Days)</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Category - Opened (30 Days)</td> <td>>0%</td> <td>0% - 50% Decrease</td> <td>>,= 50% Decrease</td> <td>0%</td> </tr> <tr> <td>Category - Clicked (30 Days)</td> <td>>0%</td> <td>0% - 70% Decrease</td> <td>>,= 70% Decrease</td> <td>0%</td> </tr> <tr> <td>Category - Sent (90 Days)</td> <td>---</td> <td>---</td> <td>---</td> <td>Always Neutral</td> </tr> <tr> <td>Category - Delivered (90 Days)</td> <td>>,= 98%</td> <td>95% - 98%</td> <td><,= 95%</td> <td>---</td> </tr> <tr> <td>Category - Opened (90 Days)</td> <td>---</td> <td>---</td> <td>---</td> <td>Always Neutral</td> </tr> <tr> <td>Category - Clicked (90 Days)</td> <td>---</td> <td>---</td> <td>---</td> <td>Always Neutral</td> </tr> <tr> <td>Emails Not Reaching the Inbox</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>ISP - Blocks (change from last period)</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Bounces</td> <td><,= 1%</td> <td>1% - 3%</td> <td>>,= 3%</td> <td>---</td> </tr> <tr> <td>Spam Traps - Pristine</td> <td>Neg Infinity to 0% [inclusive]</td> <td>0% - 20% Increase</td> <td>>,= 20% Increase</td> <td>---</td> </tr> <tr> <td>Spam Traps - Pristine</td> <td>Neg Infinity to 0% [inclusive]</td> <td>0% - 20% Increase</td> <td>>,= 20% Increase</td> <td>---</td> </tr> <tr> <td>Spam Traps - Recycled</td> <td>Neg Infinity to 0% [inclusive]</td> <td>0% - 20% Increase</td> <td>>,= 20% Increase</td> <td>---</td> </tr> <tr> <td>Spam Traps - Typo</td> <td>Neg Infinity to 0% [inclusive]</td> <td>0% - 20% Increase</td> <td>>,= 20% Increase</td> <td>---</td> </tr> <tr> <td>Unsubscribes - Category (change from last period)</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Spam Complaints - Category (change from last period)</td> <td>>0%</td> <td>0% - 20% Decrease</td> <td>>,= 20% Decrease</td> <td>0%</td> </tr> <tr> <td>Open Rate - 30 Days</td> <td>>0%</td> <td>0% - 50% Decrease</td> <td>>,= 50% Decrease</td> <td>0%</td> </tr> <tr> <td>Click Rate - 30 Days</td> <td>>0%</td> <td>0% - 70% Decrease</td> <td>>,= 70% Decrease</td> <td>0%</td> </tr> </table> ## How data from mailbox providers or ISP (inbox service provider) is shown Throughout the report, we provide data on how your email is performing at top mailbox providers. A mailbox provider or ISP (inbox service provider) is an organization that provides services for recipients to receive mail and send one-to-one communication. In this report, we include: * Gmail (gmail.com) * Microsoft (hotmail.com, outlook.com, live.com, msn.com) * Yahoo (yahoo.com, ymail.com) * AOL (aol.com, aim.com) * ‘Other’ (all remaining domains, including business and international domains) * ‘All’ (all domains combined) – we’ll assess the performance of your mailbox providers by comparing them to the ‘All’ category as your baseline. ## At a Glance In this section of the report, you’ll see a snapshot of your overall deliverability health and email marketing performance. You’ll see: <table> <tr> <th>Term</th> <th>Definition</th> </tr> <tr> <td>Total Sent</td> <td>This refers to the total messages we attempt to deliver to mailbox providers after we remove the addresses listed in your suppression list.</td> </tr> <tr> <td>Total Delivered</td> <td>This is calculated by dividing the total volume of emails delivered by the total volume of emails sent. Note: “delivered” doesn’t necessarily mean your email hit the inbox—just that it was accepted by the receiving server and wasn’t bounced or rejected. Mailbox providers can accept “delivery” of a message and place it in the spam folder or other destinations outside of your main/primary inbox.</td> </tr> <tr> <td>Total Unique Opened</td> <td>This is the total unique opens percentage is the number of unique individuals that have opened your emails. The unique open rate is that number divided by the total number of delivered messages.</td> </tr> <tr> <td>Total Unique Clicked</td> <td>This is the total unique clicks percentage is the number of unique individuals that have clicked the links in your emails. The unique click rate is that number divided by the total number of delivered messages.</td> </tr> </table> ## Sent Section This section analyzes the volume of emails sent during this reporting period. The volume of email sent on any given day influences deliverability metrics and can give insight into why certain deliverability metrics may be higher or lower than in previous periods. In the **Is your Email Volume Impacting Deliverability** chart, we show you how your sending volume might be impacting leakage. We calculate leakage by combining your bounced and blocked emails. Senders who are experiencing an issue with leakage will see a thicker purple line, as in the chart below. ![]({{root_url}}/img/emailvolumechart-expertinsights.png) ## Delivered Section This section analyzes the factors that contribute to your sender reputation. Typically, an email is not delivered to a recipient’s inbox because it is either bounced or blocked by the mailbox service provider. High bounce rates are commonly caused by misspelled or nonexistent email addresses. High block rates occur when the recipient email address is valid but something else about this message caused the message to be undeliverable, which can be as simple as a mailbox being full or more urgent like being added to a deny list. In the **IP Health by Delivered Rate** chart, we determine your IP health based on numerous backend metrics and health indicators. ## Open and Clicked Section In the **Top and Bottom Performing Subject Lines by Category** charts, we highlight your top and bottom performing campaigns so that you can identify the best practices for your audience and apply them throughout your email program. We’ve made these calculations by weighing your higher volume campaigns more on engagement than lower volume campaigns and scoring your lower volume campaigns towards the median, thus removing your 1:1 transactional or smaller marketing campaigns. In the **Unique Opens by Device** chart, we define the categories as follows: <table class="table table-striped"> <tr> <th>Device</th> <th>Description</th> </tr> <tr> <td>Desktop</td> <td>Email software on desktop computer I.E. Outlook, Sparrow, or Apple Mail.</td> </tr> <tr> <td>Webmail</td> <td>A web-based email client (Yahoo, Google, AOL, Outlook.com, etc.).</td> </tr> <tr> <td>Phone</td> <td>A smart phone (iPhone, Android, Blackberry, etc.).</td> </tr> <tr> <td>Tablet</td> <td>A tablet computer (iPad, android based tablet, etc.).</td> </tr> <tr> <td>Other</td> <td>An unrecognized device.</td> </tr> </table> <call-out> Need additional help? SendGrid's team of Email Consultants have over 95 years of combined email experience. If you're having any email issues or would like advice on how to optimize engagement, [talk to one of our consultants](https://sendgrid.com/contact-expert-services/) today! </call-out> ================================================ FILE: content/docs/ui/analytics-and-reporting/mailbox-provider-comparison.md ================================================ --- seo: title: Mailbox Provider Comparison Statistics description: Compare your Mailbox Provider specific email statistics. keywords: Mailbox Provider comparison statistics, Compare SendGrid Mailbox Provider statistics title: Mailbox Provider Comparison group: statistics weight: 0 layout: page navigation: show: true --- <call-out> Parent accounts will see aggregated statistics for their account and all subuser accounts. Subuser accounts will only see their own statistics. </call-out> Mailbox provider information can help optimize your email sending by showing you how different mailbox providers affect how your recipients interact with your email. As a result, you may want to compare one mailbox provider to another to see differences or to see if a recent change has made an improvement. The mailbox provider comparison tool allows you to do this. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Comparison Overview Your top most graph will show you how each selected mailbox provider has fared for the selected individual metric in the donut graph (mmm donuts). ## Individual Metrics Comparison This graph will show you the mailbox provider statistics for the selected metric. To change the metric, select it from the button at the top of the page. You can remove individual providers from the graph by clicking the button above and to the right of this chart and unchecking the boxes next to the provider name. The graph will refresh, showing only the statistics for the selected mailbox providers. ## Individual Metrics Figures This table will be titled “Figures for Delivered” and will show you the actual delivery numbers over time for each of the compared providers. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [Mailbox Provider Stats](https://app.sendgrid.com/statistics/mailbox_provider) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) - [Account Settings]({{root_url}}/ui/account-and-settings/account/) ================================================ FILE: content/docs/ui/analytics-and-reporting/marketing-campaigns-stats-overview.md ================================================ --- seo: title: Marketing Campaigns Statistics Overview description: Understand each statistic available for Twilio SendGrid Marketing Campaigns. keywords: analytics-and-reporting, SendGrid analytics-and-reporting, analytics-and-reporting Overview, analytics-and-reporting UI, marketing campaigns title: Marketing Campaigns Statistics Overview group: statistics layout: page navigation: show: true --- As a Marketing Campaigns customer, you can export statistics about your Single Sends and Automations. The following statistics are available for export in comma separated values (CSV) format. Stats marked with an asterisk, \*, are also displayed within the SendGrid App's user interface (UI). Stats that are displayed in the UI for A/B Testing only are marked with a double asterisk, \*\*. ## Statistics ### Requests\* The number of emails you asked Marketing Campaigns to deliver. Each attempt to send email to your customers via SendGrid is considered a [request]({{root_url}}/glossary/request/). ### Delivered\* The number of emails that were accepted by the receiving inbox server. Delivered is calculated as the number of emails requested minus the number of emails that were [suppressed]({{root_url}}/ui/sending-email/index-suppressions/), [bounced]({{root_url}}/glossary/bounces/), or [blocked]({{root_url}}/glossary/blocks/). See our [delivery]({{root_url}}/glossary/deliveries/) glossary entry for more about email delivery and deliverability. - Please note that delivered doesn’t necessarily mean your email hit the inbox, just that it was accepted by the receiving server and wasn’t bounced or rejected. Mailbox providers can accept “delivery” of a message and place it in the spam folder or other destinations outside of recipients’ main/primary inboxes. - To view the cumulative Delivered Rate (Delivered/Requests) in the SendGrid App as a cumulative percentage to-date, click the action menu and choose “View stats as percentages.” ### Total Opens\*\* The number of times that your email was opened, including multiple opens by the same recipient. See our [Total Opens]({{root_url}}/glossary/opens/) glossary entry for more about total opens and unique opens. - In legacy Marketing Campaigns, this is called “Opens.” ### Daily Total Open Rate Calculated by dividing the Total Opens by Delivered for each day in your CSV export. - In legacy Marketing Campaigns, this is called “Daily Open Rate.” ### Cumulative Total Open Rate Calculated by aggregating the number of Total Opens on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - In legacy Marketing Campaigns, this is called “Cumulative Open Rate.” ### Unique Opens\* The number of unique recipients that opened your email, regardless of how many times an individual may have opened the email. Learn more about opens and unique opens in our [Unique Opens]({{root_url}}/glossary/opens/) glossary entry. ### Daily Unique Open Rate Calculated by dividing the Unique Opens by Delivered for each day in your CSV export. ### Cumulative Unique Open Rate\* Calculated by aggregating the number of Unique Opens on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - To view in the UI as a cumulative percentage to-date, click the action menu and choose “View stats as percentages” ### Total Clicks\*\* The number of times that recipients clicked within your email, including multiple clicks by the same recipient on the same links. - In legacy Marketing Campaigns, this is called “Clicks.” ### Daily Total Click Rate Calculated by dividing the Total Clicks by Delivered for each day in your CSV export. This is also commonly referred to as the Click Through Rate. - In the email marketing industry, Unique Click Rate is commonly referred to as Total Click Through Rate. - In legacy Marketing Campaigns, this is called “Daily Click Rate.” ### Cumulative Total Click Rate Calculated by aggregating the number of Total Clicks on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - In the email marketing industry, Unique Click Rate is commonly referred to as Total Click Through Rate. - In legacy Marketing Campaigns, this is called “Cumulative Click Rate.” ### Unique Clicks\* The number of unique recipients that clicked your email, regardless of how many times an individual may have clicked within the email. ### Daily Unique Click Rate Calculated by dividing the Unique Clicks by Delivered for each day in your CSV export. - In the email marketing industry, Unique Click Rate is commonly referred to as Click Through Rate. ### Cumulative Unique Click Rate\* Calculated by aggregating the number of Unique Clicks on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - In the email marketing industry, Unique Click Rate is commonly referred to as Click Through Rate. - To view in the UI as a cumulative percentage to-date, click the action menu and choose “View stats as percentages” ### Daily Unique Click-to-Open Rate\*\* Calculated by dividing the Unique Clicks by Unique Opens for each day in your CSV export. - In legacy Marketing Campaigns, this is called “CTR” or “Click Through Rate” ### Daily Total Click-to-Open Rate\*\* Calculated by dividing the Total Clicks by Total Opens for each day in your CSV export. - In legacy Marketing Campaigns, this is called “TCTR” or “Total Click Through Rate” ### Bounces\* The number of emails that bounced instead of being delivered. Learn more about bounces in our [Bounces]({{root_url}}/glossary/bounces/) glossary entry. ### Daily Bounce Rate Calculated by dividing the Bounces by Delivered for each day in your CSV export. ### Cumulative Bounce Rate\* Calculated by aggregating the number of Bounces on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - To view in the UI as a cumulative percentage to-date, click the action menu and choose “View stats as percentages” ### Bounce Drops The number of emails that Marketing Campaigns [dropped]({{root_url}}/glossary/drops/) or did not send to because the recipient is on your Bounced list. ### Spam Reports\* The number of recipients who marked your email as spam. ### Daily Spam Reports Rate Calculated by dividing the Spam Reports by Delivered for each day in your CSV export. ### Cumulative Spam Reports Rate\* Calculated by aggregating the number of Bounces on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - To view in the UI as a cumulative percentage to-date, click the action menu and choose “View stats as percentages” ### Spam Report Drops The number of emails that Marketing Campaigns [dropped]({{root_url}}/glossary/drops/) or did not send because the recipient is on your Spam Report list. ### Unsubscribes\* The number of recipients who chose to unsubscribe from within the specific email. ### Daily Unsubscribe Rate Calculated by dividing the Unsubscribes by Delivered for each day in your CSV export. ### Cumulative Unsubscribe Rate\* Calculated by aggregating the number of Unsubscribes on a given day with the preceding days, and dividing that by the aggregate of Delivered emails for that day and preceding days. - To view in the UI as a cumulative percentage to-date, click the action menu and choose “View stats as percentages.” ### Invalid Emails The number of recipient email addresses you attempted to send to that were not formatted correctly. Learn more in our [Invalid Emails]({{root_url}}/glossary/invalid-email/) glossary entry. ================================================ FILE: content/docs/ui/analytics-and-reporting/marketing-campaigns-stats.md ================================================ --- layout: page weight: 40 title: Marketing Campaigns Statistics group: statistics navigation: show: true seo: title: Marketing Campaigns Statistics override: true description: --- ​ <call-out> ​ This page refers to the new Marketing Campaigns product. If you’re using legacy Marketing Campaigns, your workflow will be a little different and your screen won’t look the same as the screenshots. ​ </call-out> ​ With Marketing Campaigns email statistics, you can unlock the full potential with the right data at your fingertips. Use your data to guide you to the right strategy. Get insights about both marketing and transactional email for a 360-degree understand of your audience’s experience. Finally, use your data to brings results to life and share your performance with teammates and stakeholders. ​ ## Viewing Single Send or Automation Statistics Once you send a Single Send or set an Automation live, you can view related statistics. ​ 1. Navigate to the Single Send or Automation you want to view the statistics for. 1. Click the name of the Single Send or Automation to view the statistics. ​ From the statistics page, you will be able to see your bounces, clicks, opens, etc. ​ <call-out> ​ Want deeper data and insights? With [SendGrid Email Insights Reports](https://go.sendgrid.com/Email-Insights-Reports.html?utm_source=docs), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. ​ </call-out> ​ ## Click Tracking With click tracking, you can see how many clicks each individual link in your Single Sends and Automation emails received. Marketing Campaigns lists each link separately, including links that appear multiple times. For example, links that appear at both the top and bottom of an email. ​ Marketing Campaigns will provide the "URL location" for each link, ordered top left to bottom right. You can use this to identify the link if multiple URLs are the same, and to understand which link locations are more or less engaging. <call-out> Click tracking was released on 7/16/2020. To enable click tracking for automations set live prior to 7/16/2020, pause the automation and set it to live once again. Click tracking will populate data from 7/16/2020 onward regardless of when it is set live. Click tracking is not available for Single Sends sent prior to 7/16/20. </call-out> ### Click Tracking for A/B tests ​ A/B tests are a special case for link click tracking. ​ ![Link tracking results]({{root_url}}/img/link-tracking-tne.png 'Link tracking results') ​ Each tab shows all-time clicks for each of the variants sent as part of a test sample size, as opposed to clicks just earned during the testing period. For example, if the sample size for a Single Send was 100 emails for each variant, you would see the engagement with those 100 emails inclusive of and beyond the test period. In other words, if the test period is 24 hours, but someone who received the test email opened it 48 hours later, that click would be included in the variant tab. ​ This means that if the winner were selected by clicks, there's a chance that in a test period, Version B could win, but over time, Version A could end up earning more clicks. ​ ## Additional Resources - [Sending a Campaign]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [A/B Testing Your Campaign]({{root_url}}/ui/sending-email/a-b-testing/) ================================================ FILE: content/docs/ui/analytics-and-reporting/migrating-from-the-new-relic-plugin.md ================================================ --- layout: page weight: 0 title: Migrating from The SendGrid for New Relic Plugin group: partners navigation: show: true seo: title: Migrating from the SendGrid for New Relic Plugin --- <call-out type="warning"> Starting Wednesday June 16, 2021, New Relic will [no longer support or maintain plugins](https://discuss.newrelic.com/t/new-relic-plugin-eol-wednesday-june-16th-2021/127267). After June 16, 2021, you will no longer be able to access visualizations of your email statistics without changes to your New Relic dashboard. To make these changes, follow the guide on this page. **If you do not utilize New Relic to see email statistics, then there is no action needed from you.** </call-out> <call-out type="warning"> The following guide will not work for customers using New Relic’s [High Security Mode](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode/). If you are, or believe you may be, using New Relic's High Security Mode, please contact the [New Relic support team](https://support.newrelic.com/) for assistance. </call-out> The legacy SendGrid for New Relic plugin provided the following four charts. * **Deliveries**: This shows Average aggregations for Requests, Drops, Deferrals, Delivered * **Engagement**: This shows Average aggregations for Unsubscribes, Clicks, Unique Opens and Opens * **Compliance**: This shows Average aggregations for Bounces, Spamreports and Blocked * **Percentage**: Shows percentages for various stats You can follow the instructions in this document to build each chart without relying on the plugin. The quickest way to construct your dashboards is by importing them using our prebuilt queries, which you'll find in the ["Import prebuilt dashboards"](#import-prebuilt-dashboards) section. You can also build your dashboards manually by following the steps in the ["Build your dashboards manually"](#build-your-dashboards-manually) section. Because we make it possible to view stats for Subusers, there are separate prebuilt dashboards and instructions to create dashboards with or without Subuser support. **Legacy plugin view** ![A legacy New Relic dashboard built with the SendGrid for New Relic Plugin]({{root_url}}/img/NR_OldPluginView.jpg 'Legacy New Relic plugin dashboard') ## Import prebuilt dashboards You can import one of the Twilio SendGrid prebuilt dashboards after specifying your New Relic AccountID in the template. For more information about working with dashboards, please see the [New Relic Dashboards documentation](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/). *To retrieve your New Relic Account ID* 1. Navigate to **Manage your plan** in your New Relic account settings as shown below. ![The New Relic account settings page]({{root_url}}/img/NR_FindAccountNumber.jpg 'Manage your plan') <call-out> Depending on your organization structure in New Relic, you may find your AccountID in different ways. See the [New Relic documentation](https://docs.newrelic.com/docs/accounts/accounts-billing/account-setup/account-id/) if you are unable to locate your ID. </call-out> ## Importing dashboards The two prebuilt JSON files below allow you to import a dashboard with or without support for Subuser statistics. The process for importing a dashboard is the same when using either file. * [TwilioSendGrid\_Sample\_Dashboard\_NoSubusers.json]({{root_url}}/assets/TwilioSendGrid_Sample_Dashboard_NoSubusers.json) * [TwilioSendGrid\_Sample\_Dashboard\_WithSubusers.json]({{root_url}}/assets/TwilioSendGrid_Sample_Dashboard_WithSubusers.json) *To import the prebuilt dashboard* 1. Locate the `"accountId"` field in the JSON file you selected and replace its value with your AccountID. 2. From your New Relic dashboards page, select **Import a dashboard**. 3. Paste the dashboard JSON from the linked file above, and the dashboard will be created. ![Import a dashboard]({{root_url}}/img/NR_ImportDashboard.jpg 'Import a dashboard') Once imported, a dashboard without Subusers will look like the following screenshot. Make sure you select a date range for which you know statistics will be available. ![Example imported dashboard]({{root_url}}/img/NR_StandardDashboardViewWithoutSubusers.jpg 'Example imported dashboard') A dashboard with support for Subusers will provide multiple views. The main, or parent, account for a dashboard with Subusers will look like the following screenshot. *To view the main dashboard* 1. Click on **TwilioSendgrid**. 2. Select a date range for which you know statistics will be available. ![Example imported dashboard with Subusers on the main user]({{root_url}}/img/NR_SubuserDashboard_SelectMainUser.jpg 'Example imported dashboard with Subusers') To view a specific Subuser's stats 1. Click on the Subuser. 2. Select a date range for which you know statistics will be available. ![Example imported dashboard for a specific Subusers]({{root_url}}/img/NR_SubuserDashboard_SelectSubuser.jpg 'Example imported dashboard for a specific Subusers') ## Build your dashboards manually If the prebuilt templates don't work as you expect, you can build your dashboards from scratch. ### Add data to a dashboard The following sections of this guide assumes you have already created a New Relic dashboard. For help creating a dashboard, see the [New Relic dashboard documentation](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/#:~:text=You%20can%20easily%20create%20a,corner%20of%20the%20dashboards%20index.). *To add data to your dashboard* 1. Click the **Add to your Dashboard** (**+**) button. ![Add to your dashboard]({{root_url}}/img/NR_AddToDashboard.jpg 'Add to your dashboard') 2. A page menu will load with options to add to your dashboard. Select **Add a chart**. This option will allow you to add a query. ![Add to your dashboard menu]({{root_url}}/img/NR_AddAChart.jpg 'Add to your dashboard menu') 3. Select [NRQL](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/#what-is-nrql). ![Add NRQL query]({{root_url}}/img/NR_SelectNRQL.jpg 'Add NRQL query') 4. You will now be able to add an NRQL query to visualize your SendGrid statistics. The following query displays all stats for Deliveries using an average aggregate function. ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/TwilioSendGrid/Deliveries/{Stat}' TIMESERIES FACET Stat ``` <call-out> You can use any of the [NRQL aggregate functions](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/#aggregator-functions) you like. The legacy SendGrid for New Relic plugin showed Average. </call-out> 5. Click **Run**. This will run the query and retrieve the specified statistics. 6. Name the chart "Deliveries." 7. Click **Save**. ![Save added query]({{root_url}}/img/NR_CreateChartWithNRQLAndSave.jpg 'Save added query') You can now select a timeline to view your stats. ![Select a timeline]({{root_url}}/img/NR_SelectTimeline.jpg 'Select a timeline') Now that we know how to add a chart with a query, most of the charts are similar except a few that are covered in the next section. ### Add charts without Subusers The following queries will allow you to visualize your Deliveries, Engagement, Compliance, and Percentage data. For more information about working with the Twilio SendGrid Stats API, see our [API reference](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics). To add these queries to your dashboard, follow the process outlined in the previous ["Add data to a dashboard"](#add-data-to-a-dashboard) section. #### Deliveries ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/TwilioSendGrid/Deliveries/{Stat}' TIMESERIES FACET Stat ``` #### Engagement ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/TwilioSendGrid/Engagement/{Stat}' TIMESERIES FACET Stat ``` #### Compliance ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/TwilioSendGrid/Compliance/{Stat}' TIMESERIES FACET Stat ``` #### Percentage A percentage is not a TIMESERIES and must be viewed as a table or bar. Be sure to set up your percentage appropriately when selecting a **Chart type**. ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND StatPercent LIKE '%Percent' WITH METRIC_FORMAT 'Custom/TwilioSendGrid/{Categories}/{StatPercent}' FACET Categories, StatPercent ``` ![Select a Chart type for your percentage query]({{root_url}}/img/NR_PercentageChartForNonSubuser.jpg 'Select a Chart type') ### Add charts with Subuser support The following queries allow you to build charts with Subuser support. Before using these queries, you must first add a User Widget. This Users Widget is needed to view statistics for either the main account (under **TwilioSendgrid**) or one of the Subusers. The widget queries and pulls all Users. **To add the Users Widget** 1. Add the following NRQL query to your dashboard. ```SQL FROM Metric SELECT MIN(newrelic.timeslice.value) as MIN WHERE appName = 'Twilio SendGrid' WITH METRIC_FORMAT 'Custom/{AllUsers}/{Categories}' FACET AllUsers ``` 2. Set the **Chart type** to **Table**. ![Set up the Users Widget]({{root_url}}/img/NR_AllUsersWidgetAsTable.jpg 'Set up the Users Widget') With the Users Widget in place, you can add the following queries to visualize your Deliveries, Engagement, Compliance, and Percentage data for your main account and any Subuser. For more information about working with the Twilio SendGrid Stats API, see our [API reference](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics). To add these queries to your dashboard, follow the process outlined in the previous ["Add data to a dashboard"](#add-data-to-a-dashboard) section. #### Deliveries with Subusers ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/{AllUsers}/Deliveries/{Stat}' TIMESERIES FACET AllUsers, Stat ``` #### Engagement with Subusers ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/{AllUsers}/Engagement/{Stat}' TIMESERIES FACET AllUsers, Stat ``` #### Compliance with Subusers ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND metricTimesliceName NOT LIKE '%Percent' WITH METRIC_FORMAT 'Custom/{AllUsers}/Compliance/{Stat}' TIMESERIES FACET AllUsers, Stat ``` #### Percentage with Subusers A percentage is not a TIMESERIES and must be viewed as a table or bar. Be sure to set up your percentage appropriately when selecting a **Chart type**. ```SQL FROM Metric SELECT average(newrelic.timeslice.value) WHERE appName = 'Twilio SendGrid' AND StatPercent LIKE '%Percent' WITH METRIC_FORMAT 'Custom/{AllUsers}/{Categories}/{StatPercent}' FACET AllUsers, StatPercent ``` ![Select a Chart type for your percentage query with Subusers]({{root_url}}/img/NR_PercentageChartWithSubuser.jpg 'Select a Chart type') ### View all custom metrics It is also possible to view all custom metrics using New Relic. *To view all custom metrics available* 1. Click **New Relic One** at the top left corner and navigate to **APM**. 2. Click **Twilio SendGrid** to load the "Explorer view." ![Load the Explorer view]({{root_url}}/img/NR_ViewCustomMetrics_Step1.jpg 'Load the explorer view') 3. From the left navigation, scroll down all the way and expand **More views**. 4. Click on **Metrics Explorer** and select the appropriate timeline to view the custom metrics. You can now search and browse specific custom metrics. ![A list of all custom metrics]({{root_url}}/img/NR_ViewCustomMetrics_Step2.jpg 'A list of all custom metrics') ## Troubleshooting * Make sure you select a time range containing some expected stats, or else nothing will populate. * Sometimes New Relic dashboards error. Refreshing the dashboard usually fixes the problem. * Stats captured from the legacy SendGrid for New Relic plugin will not be visible when using the new integration. ## Additional resources * [How to query APM metric timeslice data](https://docs.newrelic.com/docs/telemetry-data-platform/understand-data/metric-data/query-apm-metric-timeslice-data-nrql/). * [Introduction to NRQL](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/#what-is-nrql). * [Introdution to New Relic Dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/#:~:text=You%20can%20easily%20create%20a,corner%20of%20the%20dashboards%20index). * [NRQL aggregate functions](https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/#aggregator-functions). ## FAQ **What is the purpose of the Min column in the Users widget?** You can ignore the Min column. When creating a query to retrieve all Subusers along with the main parent user, we used an aggregate function, which is required to build the dashboard. However, the value of this function is not needed, and it is not possible to delete the aggregate function. For this reason, you can safely ignore the Min column. **Can I view my Twilio Sendgrid stats without using the New Relic integration?** You can use Twilio Sendgrid APIs to retrieve the raw stats numbers. For more information about working with the Twilio SendGrid Stats API, see our [API reference](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics). **Why don't I see any Stats on my dashboard?** Make sure you have selected an appropriate time range in which you expect some Stats. **Who do I contact for help related to NRQL or building a dashboard?** Though we have provided guidelines here, for any questions or issues related to NRQL or building Dashboards, please refer to the linked [New Relic documentation]() or [contact their support team](https://support.newrelic.com/). ================================================ FILE: content/docs/ui/analytics-and-reporting/spam-reports.md ================================================ --- layout: page weight: 0 title: Spam Reports group: tracking seo: title: Spam Reports description: When a recipient marks your email as spam, their mail provider will let SendGrid know. We will help to prevent you from sending email to this recipient again. keywords: spam reports, recipient spam report, recipient marked as spam, spam email report navigation: show: true --- [Spam reports]({{root_url}}/glossary/spam-reports/) happen when a recipient indicates that they think your email is [spam]({{root_url}}/glossary/spam/) and then their email provider tells SendGrid. The list provided here can be filtered by email address or date. ## Searching Spam Reports by Date In the top right corner, you will see a calendar icon. Click this and choose the spam report dates you would like to search between. Your recipient list will refresh, showing the recipients who marked your email as spam between these dates. ## Removing Recipients From The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. ## Download Spam Reports as CSV You can download your Global Unsubscribe list as a CSV by clicking the gear icon at the top of the page and selecting “Download CSV.” The file will download in your browser right away. ## Additional Resources - [Spam Reports API]({{root_url}}/api-reference/) - [Invalid Emails API]({{root_url}}/api-reference/) <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ================================================ FILE: content/docs/ui/analytics-and-reporting/stats-overview.md ================================================ --- seo: title: Statistics Overview description: View and filter all of your SendGrid account email statistics. keywords: analytics-and-reporting, SendGrid analytics-and-reporting, analytics-and-reporting Overview, analytics-and-reporting UI title: Statistics Overview group: statistics weight: 100 layout: page navigation: show: true --- Tracking your emails is an important part of being a good sender and learning about how your users interact with your email. This includes everything from basics of clicks and opens to looking at which browsers and mailbox providers your customers use. We have broken up statistics in specific ways so that you can get at-a-glance data, as well as allowing you to get into the details of how your email is being used. ## Available Email Reports <call-out> The timezone for statistics pages is set in your [account settings]({{root_url}}/ui/account-and-settings/account/). </call-out> **Overview** - The overview is your at-a-glance statistics. We give you the highlight reel so that you can keep an eye out for any issues and make sure you’re on the right track. **[Global Statistics]({{root_url}}/ui/analytics-and-reporting/global/)** - All of your statistics, aggregated in one place so you can see the high level view of everything. **[Category Statistics]({{root_url}}/ui/analytics-and-reporting/categories/)** -You can define your categories when you send, so that you can view your email performance by category later. <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> <call-out> Category statistics are available for the previous thirteen months only. </call-out> **[Category Comparison]({{root_url}}/ui/analytics-and-reporting/category-comparison/)** - Compare the performance of emails from up to 10 categories against each other. **[Subuser Statistics]({{root_url}}/ui/analytics-and-reporting/subuser/)** - You can segment your email to be sent by different subusers, which allows you to compare how each type or subset of your email is performing. **[Subuser Comparison]({{root_url}}/ui/analytics-and-reporting/subuser-comparison/)** - Compare the performance of emails from up to 10 subusers against each other. **[Geographical]({{root_url}}/ui/analytics-and-reporting/geographic/)** - See where you get the best engagement and compare engagement by geographical region. **[Email Clients and Devices]({{root_url}}/ui/analytics-and-reporting/device/)** - Find out which applications and devices your recipients use to view your mail and see the statistics for each. **Mailbox Provider Statistics** - See all the statistics for the mailbox providers your recipients use. **[Mailbox Provider Comparison]({{root_url}}/ui/analytics-and-reporting/mailbox-provider-comparison/)** - Compare the performance of emails by statistic and provider. **[Browser Statistics]({{root_url}}/ui/analytics-and-reporting/browser/)** - See all the statistics for the web browsers your users view your emails from. **[Browser Comparison]({{root_url}}/ui/analytics-and-reporting/browser-comparison/)** - Compare the performance of your emails by statistic and browser. **[Parse Webhook]({{root_url}}/for-developers/parsing-email/inbound-email/)** - View the number of requests you have received via the Parse Webhook. ## Metrics <p> On the available statistics reports, you will find that your deliverability is broken down by the following metrics. Each one gives you a different piece of information about how SendGrid or your recipients interact with your email. </p> <p> **[Blocks]({{root_url}}/glossary/blocks/)** - The number of emails that were not allowed to be delivered by ISPs. **[Bounces]({{root_url}}/glossary/bounces/)** - The number of emails that bounced instead of being delivered. **[Clicks]({{root_url}}/glossary/clicks/)** - The number of links that were clicked in your emails. **[Delivered]({{root_url}}/glossary/deliveries/)** - The number of emails SendGrid was able to confirm were actually delivered to a recipient. **Invalid Emails** - The number of recipients that you sent emails to, who had malformed email addresses or whose mail provider reported the address as invalid. **[Opens]({{root_url}}/glossary/opens/)** - The total number of times your emails were opened by recipients. **[Requests]({{root_url}}/glossary/request/)** - The number of emails you requested to send via SendGrid. **[Spam Reports]({{root_url}}/glossary/spam-reports/)** - The number of recipients who marked your email as spam. **[Unique Opens]({{root_url}}/glossary/opens/)** - The number of unique recipients who opened your emails. **[Unique Clicks]({{root_url}}/glossary/clicks/)** - The number of unique recipients who clicked links in your emails. **Unsubscribes** - The number of recipients who unsubscribed from your emails. **Unsubscribe Drops** - The number of emails dropped by SendGrid because the recipient unsubscribed from your emails. ## Filters These filters are available on most of the statistics pages. They will help you see your statistics in more or less details, depending on your needs. **Metric Filters** - You can select all of the metrics or only some of them. **Date Filters** - To display statistics between specific dates, choose your date range. **Grouping Filter** - Display statistics grouped by day, week, or month. ## Top 5 Categories The Top 5 Categories report allows you to see your top 5 most used categories by number of requests. Switch your view by actual number of emails or percentage using the toggle at the top right of this section. <call-out> Want deeper data and insights? With [SendGrid Email Insights Reports]({{root_url}}/ui/analytics-and-reporting/subscribing-to-expert-insights/), you’ll get access to more data about your email performance plus customized insights from a deliverability consultant. </call-out> ## Additional Resources - [API Statistics Overview](https://sendgrid.api-docs.io/v3.0/stats/retrieve-global-email-statistics) ================================================ FILE: content/docs/ui/analytics-and-reporting/subscribing-to-expert-insights.md ================================================ --- layout: page weight: 0 title: Subscribing to Expert Insights group: expert-insights seo: title: Subscribe to Expert Insights description: Learn how subscribing to the Expert Insights Report can enhance your email performance keywords: navigation: show: true --- Expert Insights is a monthly report that will give you deeper visibility into the health and performance of your email program. This report equips you with the data and insights you need to reach the inbox and increase your email ROI. **See an example of [Expert Insights report.](https://sendgrid.com/wp-content/uploads/pdf/Expert-Insights-Sample.pdf)** Expert Insights is designed to help you: - Understand your performance trends in an easy-to-understand, shareable format. - Identify areas of improvement with in-depth data on the factors that impact deliverability. - Know exactly what to do if you run into an issue with step-by-step instructions from our experts. ## How Expert Insights Works Expert Insights analyzes your email funnel, providing visibility into how your email is performing as it is sent, delivered, opened, and clicked by your recipients. The report highlights any potential leakage points (for example, blocked emails) and opportunities to improve deliverability and engagement based on our deep expertise in email. This report spans a calendar month. Throughout the report, we compare data period-to-period (30-days to the previous 30-days). To get the most out of Expert Insights, we recommend that customers have [click- and open-tracking enabled]({{root_url}}/ui/account-and-settings/tracking/) and that customers use categories to separate their email data. <call-out> For privacy reasons, your first Expert Insights report will cover 37 days of data or as much time as you’ve been a SendGrid customer. If you're a new customer, SendGrid will populate areas of the report that look back past 37 days over time. </call-out> <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> [Categories](https://sendgrid.com/docs/ui/analytics-and-reporting/categories/) help organize your email analytics by enabling you to tag emails you send by topics you define. We recommend using 3-5 categories so we can provide more detailed email analytics in your Expert Insights report. Reports are generated per [subuser.](https://sendgrid.com/docs/ui/account-and-settings/subusers/) Please reach out to our [Sales team](https://sendgrid.com/contact-us-form/) to purchase reports for multiple subusers. ## How to Subscribe to Expert Insights 1. Before you purchase Expert Insights, you will need to determine the subusers that you want to us to run a report on and where we should email the reports. We can send your reports to up to 3 email addresses. 1. Pro customers can purchase Expert Insights directly on their [Billing page.](https://app.sendgrid.com/account/billing) If you’re a Premier customer, please [contact sales](https://sendgrid.com/expert-services-questions/) or speak to your Customer Success Manager to purchase Expert Insights. 1. After you complete your purchase, you will receive your first report at the email addresses you’ve provided us as well as at your account administration email address within 1-2 business days. Moving forward, Expert Insights will appear on your regular monthly [invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/). If you purchase the report before the first of the month, prorated charges for your report will appear on your next invoice, as well as the full charge for next month’s report. 1. We will send your monthly report to the emails you’ve provided us at the beginning of each month. <call-out> Currently, only Pro and Premier accounts can purchase Expert Insights. </call-out> <call-out> Need additional help? SendGrid's team of Email Consultants have over 95 years of combined email experience. If you're having any email issues or would like advice on how to optimize engagement, [talk to one of our consultants](https://sendgrid.com/contact-expert-services/) today. </call-out> ## Managing Your Expert Insights Subscription Please reach out to our [Support team](https://support.sendgrid.com/hc/en-us) at any time to change the email recipients of your monthly reports or the subuser that the report pertains to. - Pro customers can cancel their Expert Insights directly on their [Billing page.](https://app.sendgrid.com/account/billing) - Premier customers should reach out to their Customer Success Manager to cancel their subscription. - If you cancel your Expert Insights subscription, you will no longer receive monthly reports. This change is reflected on your invoice in the following month. - If you have would like to cancel your subscription for a specific user or users, please contact our [Support team.](https://support.sendgrid.com/hc/en-us) You will still receive a report if you have paid for a report this month but have not yet received it. This will be your final report. We will immediately stop collecting your data after your last report. While you can always re-purchase Expert Insights through our [Sales Team,](https://sendgrid.com/expert-services-questions/) note that you will see a gap in your report data if you do so. ================================================ FILE: content/docs/ui/analytics-and-reporting/subuser-comparison.md ================================================ --- seo: title: Subuser Statistics Comparison description: View and compare your subuser specific email statistics. keywords: compare subuser statistics, SendGrid compare subuser statistics, subuser statistic comparison title: Subuser Statistics Comparison group: statistics weight: 0 layout: page navigation: show: true --- <call-out> This page refers to our beta UI functionality. To find these features, please click the “Beta” button at the top of the SendGrid UI. </call-out> <call-out> On all other statistics pages, your subuser statistics are “rolled up” into the parent account’s statistics. From this page, you can see how each subuser affects your overall statistics. </call-out> Subusers can help organize your email sending an analytics by enabling you to segment by a different sender and IP address. As a result, you may want to compare one subuser to another. The category comparison tool allows you to do this. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Select Your Subusers You can compare up to 10 subusers at a time. To select them, click the “+” sign next to each subuser name in the left-side list. Then, click the “Compare” button. ## Comparison Overview Once you have selected the subusers, your top most graph will show you how each selected subuser has fared for each individual metric in a single graph. Each subuser will be assigned a color in this bar chart. You can remove individual subusers from the list of subusers you selected initially, by clicking the “Subusers” button and unchecking subusers. The graph will refresh, showing only the selected subusers. ## Individual Metrics Comparison When you initially choose the subusers to compare, this graph will be titled “Comparison for Deliveries” and will show you the delivery rates over time for each of the compared subusers. You can remove individual subusers from the list of categories you selected initially, by clicking the “Subusers” button and unchecking subusers. The graph will refresh, showing only the selected subusers. To change this graph to see another metric for your subusers, click the button next to the “Subusers” button and choose another metric. ## Individual Metrics Figures When you initially choose the subusers to compare, this table will be titled “Figures for Delivered” and will show you the actual delivery numbers over time for each of the compared subusers. You can remove individual subusers from the list of categories you selected initially, by clicking the “Subusers” button and unchecking subusers. The graph will refresh, showing only the selected subusers. To change this graph to see another metric, click the button inline with the graph title and choose another metric. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. ## Additional Resources - [Subuser Statistics]({{root_url}}/ui/analytics-and-reporting/subuser/) - [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) ================================================ FILE: content/docs/ui/analytics-and-reporting/subuser.md ================================================ --- seo: title: Subuser Statistics description: View and filter your subuser specific SendGrid email statistics. keywords: Subuser statistics, SendGrid subuser statistics title: Subuser Statistics group: statistics weight: 0 layout: page navigation: show: true --- Subusers can help organize your email sending and analytics by enabling you to segment by a different sender and IP address. Just as you can view the statistics on all your [email activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/), you can go a step further and view the statistics broken down to a particular subuser. The actual statistics included vary depending upon your [account settings]({{root_url}}/ui/account-and-settings/account/). Emails sent, bounces, and spam reports will always get tracked. Unsubscribes, clicks, and opens require that the associated settings are enabled. In order to see statistics for a subuser, select the subuser and the page will show you both a graph and a table of email statistics. You can change which metrics, date, or grouping by adjusting the [statistics filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters). ## Figures The figures table gives you all of the specific counts or percentages of each event, according to how you’ve grouped your statistics (day, week, or month). For example, if you wanted to see what percentage of the emails you sent were actually opened on the second week of April, this is a great place to check. This table will refresh with new or adjusted data based on the various filters available at the top of the page. You can also choose to show actual counts or percentages, by clicking the corresponding button above and to the right of the table. ## Additional Resources - [Subuser Statistics Comparison]({{root_url}}/ui/analytics-and-reporting/subuser-comparison/) - [Email Activity]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) - [Statistics Filters]({{root_url}}/ui/analytics-and-reporting/stats-overview/#statistics-filters) ================================================ FILE: content/docs/ui/analytics-and-reporting/tracking-data-with-keen-io.md ================================================ --- layout: page weight: 90 group: partners title: Email Event Data with Keen navigation: show: true seo: title: Email Event Data with Keen --- The SendGrid [Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) lets you stream all [email events]({{root_url}}/ui/analytics-and-reporting/email-activity-feed/) directly to [Keen](https://keen.io/users/signup?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs) for real-time analysis and long term raw storage. It only takes a couple of minutes to start streaming email event data from SendGrid to Keen, and once you do, you’ll get tools to create flexible email analytics and stunning email marketing dashboards. ## Send your SendGrid Data to Keen To get started, the first thing you'll need to do is create create a Keen and SendGrid account. 1. Create a [Keen account](https://keen.io/users/signup?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs). 1. Add a new project in the Keen UI for your SendGrid Email Event Data. 1. Copy your Project ID and API Write Key from the Access tab. 1. Create a [SendGrid account](https://sendgrid.com/user/signup). ### Activate SendGrid's Event Notification App 1. Log into your SendGrid account. 1. Navigate to **Settings** from the left menu. 1.Select [**Mail Settings**](http://app.sendgrid.com/settings/mail_settings) and then click **Event Webhook**. ![SendGrid- Mail Settings - Event Webhook]({{root_url}}/images/keen/sendgrid_mailsettings_eventwebhook.png) ### Set the HTTP POST URL The HTTP Post URL is the endpoint where SendGrid will stream all of your email data. ``` https://api.keen.io/3.0/projects/YOUR_KEEN_PROJECT_ID/email/sendgrid/1.0?api_key=YOUR_KEEN_API_WRITE_KEY ``` 1. Copy and paste the above URL into the HTTP POST URL field. Make sure to replace `YOUR_KEEN_PROJECT_ID` and `YOUR_KEEN_API_WRITE_KEY` with your Project ID and API Write Key available in the Access tab. Set Authorization Method to **None**. 2. In the settings, select the events you want to post to Keen (why not all of them?). To do this, check **Select All** under **Events to be POSTed to your URL**. You can refer to SendGrid’s [event documentation]({{root_url}}/for-developers/tracking-events/event/) for more information on these events. That’s it! Now, as your emails make their way through SendGrid, all of the event information will be posted to Keen. A new Event Collection, aptly named for each type of email event, will be created within your Keen Project. ## Testing Your Integration To test that everything is working, navigate to **Event Webhook Settings** in the SendGrid app and then click **"Test Your Integration"**. This will send sample email data from SendGrid into your Keen Project. In the Keen UI, navigate to the **Streams** tab to check for sample SendGrid data. After you've confirmed the data was sent, enable the Event Webhook and your SendGrid email data will now be sent to Keen in real-time. ## Your Data: SendGrid Data Models In the SendGrid app, navigate to **Mail Settings** and then select **Event Webhook**. Each email event type that is selected will be recorded as a separate Event Collection in your Keen project. We recommended checking **Select All** to access full functionality of the Keen app’s reporting. The email events that are recorded are: - `email_bounce` - `email_click` - `email_deferred` - `email_delivered` - `email_dropped` - `email_group_resubscribe` - `email_group_unsubscribe` - `email_open` - `email_processed` - `email_spamreport` - `email_unsubscribe` As SendGrid email data streams to Keen, it will be enhanced using Keen's [Data Enrichment](https://keen.io/docs/streams/data-enrichment-overview/) capabilities. Keen’s data enrichments turn IP addresses into geographic locations and break out timestamps, URLs, and user agent strings into more easy-to-use data such as `device type`, `day_of_the_week`, and URL `path`. To explore all of the email data you have at your fingertips, log into your Keen account, select your Project with SendGrid data and open the **Streams** tab. In the search bar type in “email” to check out your data collections associated with SendGrid email data. You can click into an email event like `email_open` to view all of the different data you have to work with. <call-out> Use the property `message_id` or `singlesend_name` contained in each event to track a particular email across all of these possible actions. Similarly, you can follow a particular user's behavior via the `email` property. </call-out> ## How to Use the Data Explorer ![Keen Open Rate Query]({{root_url}}/images/keen/sendgrid_open_rate_query.png) Keen’s Data Explorer enables you to create powerful email marketing metrics by running queries on your Sendgrid event data. You can also use filters, timeframes and groupings to view different cuts of the data. After you’ve created your email metrics, you can present them all in one place using Keen’s Dashboard Creator. Check out Keen’s tutorial on [how to build a SendGrid email analytics dashboard](https://www.keen.io/blog/how-to-build-sendgrid-email-marketing-dashboard-with-keenio?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs) to learn more! ## Embedding SendGrid Analytics Into Your App With Keen, you will have access to all of your raw data for as long as you need it. An archive of all of your email data is created, which means you will have access to your historical data and can query for past user behavior. Just like SendGrid, Keen is 100% powered by APIs. This means you can embed rich analytics anywhere you can write code. Many SendGrid users find it useful to embed these email analytics into a report if they need to share the results with a client. Here’s a link to our [Customer Facing Analytics Guide](https://keen.io/docs/visualize/customer-facing-analytics/) that will give you step-by-step instructions on how to embed your SendGrid analytics into your product. You can also grab a shareable link in the Dashboard Creator. Some users also take advantage of Keen's [S3 Streaming](https://keen.io/docs/streams/extended-functionality/amazon-s3/) capabilities to write a copy of all their data to AWS. ## Additional Resources: - Check out Keen's tutorial on [How to Build a SendGrid Email Marketing Dashboard](https://www.keen.io/blog/how-to-build-sendgrid-email-marketing-dashboard-with-keenio?utm_campaign=SendGrid%202020&utm_source=SendGrid&utm_medium=SendGrid%20Hosted%20Docs) for a step-by-step guide on creating additional queries. - Keen offers a [3-part video series](https://www.youtube.com/playlist?list=PL6E4U2hk0KgOqdPkaDVqKGHLfUEJsRBW3) which covers setting up the integration, creating email metrics, and building an email marketing dashboard. - SendGrid's complete [Event Webhook Documentation]({{root_url}}/for-developers/tracking-events/event/) is a great resource on SendGrid email events. As you start to do more analysis, it's worth a read. You can even skip a lot of the sections because we've done much of the work for you. ================================================ FILE: content/docs/ui/analytics-and-reporting/tracking-stats-using-new-relic.md ================================================ --- layout: page weight: 0 title: SendGrid for New Relic group: partners navigation: show: true seo: title: SendGrid for New Relic --- <call-out type="warning"> Starting Wednesday June 16, 2021, New Relic will [no longer support or maintain plugins](https://discuss.newrelic.com/t/new-relic-plugin-eol-wednesday-june-16th-2021/127267). After June 16, 2021, you will no longer be able to access visualizations of your email statistics without changes to your New Relic dashboard. To make these changes, follow [this guide]({{root_url}}/ui/analytics-and-reporting/migrating-from-the-new-relic-plugin/) **If you do not utilize New Relic to see email statistics, then there is no action needed from you.** </call-out> Access your email statistics via the New Relic Dashboard. ![]({{root_url}}/images/new_relic.png) In less than 5 minutes your statistics should be sent to your New Relic Dashboard. We send statistics to New Relic every 5 minutes for users with the setting enabled. * * * * * ## Settings Settings may be changed through: - [SendGrid UI](https://app.sendgrid.com/settings/partners) (on an account wide basis) If you would like get your statistics in the New Relic Dashboard, you need to provide us your New Relic license key. This can be found by accessing the SendGrid's Plugin page on New Relic or from the Account Settings Page. ![]({{root_url}}/images/newrelic-settings.png) In the New Relic settings you can enable the statistics for your subusers. <call-out type="warning"> You will receive statistics only for 100 subusers </call-out> After you have entered your settings and saved them, enable the app. * * * * * ## New Relic Dashboard Go on New Relic site and there you will find the SendGrid extension on the left menu. After clicking on 'SendGrid' extension, a SendGrid instance will be displayed and if you activated the subuser options beneath the statistics of the primary account will be the statistics for subusers. ![]({{root_url}}/images/newrelic-dashboard1.png) Click on one of the instances and there you will see the statistics in 3 categories: Deliveries, Engagement, and Compliance. Also on the right side you can see metrics in percentages. ![]({{root_url}}/images/newrelic-dashboard2.png) ================================================ FILE: content/docs/ui/managing-contacts/building-your-contact-list.md ================================================ --- layout: page weight: 100 title: Building your Contact list group: managing-contacts navigation: show: true seo: title: Building your Contact list keywords: Marketing Campaigns, Contacts, Contact lists, opt-in email override: true description: Directions on how to effectively build your Marketing Campaigns Contact list. --- The best way to protect your sending reputation and get more messages in the inbox is by building your contact list organically. Here are a few ways SendGrid recommends building your contact list. ## Opt-in email Opt-in email refers to one-to-many emails, such as a newsletter or advertisements, that is sent out to a mailing list where every member of that list has actively requested email from the sender. Without obtaining this permission, your email is likely unwanted or unsolicited and is liable to be marked as spam by the recipient or the receiving mailbox provider. ### Email opt-in types - **Single Opt-in** refers to the practice of requesting permission to send a recipient email during, and only during, registration. - **Double Opt-in** refers to the practice of requesting permission twice from a recipient. For example, you could ask them if they want to receive email at registration, and then send another email asking them to verify their confirmation. - **Confirmed Opt-in** refers to the practice of sending emails to your recipients asking them to confirm their continued interest in receiving your future emails. <call-out> To avoid blocked emails, double check the spelling of the email addresses on your list. SendGrid recommends having the recipient input their address twice to ensure it is correct during the registration/sign-up process. </call-out> ## Peer-initiated email invitation requirements A peer-initiated invitation system can help your subscribers spread the word about your service and grow your user base—if done well. An aggressive invitation system can backfire, and your invitations will be filtered or blocked. SendGrid customers who implement a peer-initiated invitation system must abide by the following requirements: * Never allow your subscribers to send invitations to their entire address book. Address books contain old, stale addresses that ISPs use as spam traps. To prevent this, design your invitation system so that your subscriber must deliberately select each invitee. * Limit the number of invitations each customer can send to encourage selective, quality invitations. When your customers are careful to invite only those who they think will appreciate your service, you reduce the risk of recipients reporting the invitations as spam. If enough people mark your invites as spam, they will be blocked or filtered. * Clearly display the inviter’s name or email address, so the invitee knows who sent the invitation. (Peer-initiated invitations are most effective when the invitee knows and trusts the inviter.) * Use the inviter’s email address for the invitation emails From address. * Clearly express the purpose of the invitation. Recipients must understand what they are being invited to. * After the initial invitation, don’t send more than one follow-up (reminder) email to invitees that didn’t respond to the first invitation. SendGrid strongly recommends: * Ensuring your invitation is relevant and valued by the recipient. * Allowing inviters to add a personal text-only message to their invitation. (No URLs, as they may be used to exploit or infect the invitee.) * Including a visible, functioning opt-out link to allow the recipient to remove themselves from future mailings instead of reporting your message as spam. * Being aware of offering invitation incentives to your subscribers. Incentives may encourage them to invite people who aren’t likely to want your service, and this could backfire. * Monitoring your spam complaints. Some inviters will trigger spam complaints by sending invitations to people who don’t want them. If your system correlates spam complaints with the troublesome inviter, you can limit their invitation quota to minimize the adverse effect on your email sending reputation. * Pre-screening the email addresses you collect before you send the invitation. Ensure addresses are syntactically correct and that the domain part of the address has a DNS MX record (which indicates that the domain accepts mail). <call-out-link linktext="EXPERT SERVICES" img="/img/expert-insights-promo3.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Need a helping hand? Getting into the inbox just so you can have the chance to engage with your customers often isn’t as easy as pressing “send.” Get customized advice from our team of email experts on how to optimize your email strategy. </call-out-link> ### Additional Resources - [Lists and Segmentation]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) - [Unsubscribe Groups]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/) - [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) ================================================ FILE: content/docs/ui/managing-contacts/create-and-manage-contacts.md ================================================ --- layout: page weight: 70 title: Create and Manage Contacts group: managing-contacts navigation: show: true seo: title: Create and Manage Contacts keywords: override: true description: --- <call-out> The content on this page describes the experience in the latest version of Marketing Campaigns. If you’re using the legacy version of Marketing Campaigns, your experience may be different. To explore Marketing Campaigns plans and upgrade, click [here](https://sendgrid.com/pricing). </call-out> <iframe src="https://player.vimeo.com/video/381663627" width="640" height="480" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> ## Add Contacts You can add contacts to Marketing Campaigns by uploading a CSV, manually via the UI, using a Signup Form, or by integrating with the Contacts API. <call-out> Note that automations will only trigger to contacts who are added to an entry criteria list *after* the automation is set live. Contacts who you add to a list before the automation is set live will not receive any emails in the series. </call-out> ### Upload a CSV A common way to add contacts is to upload a CSV and map your data to custom fields. <call-out> You can upload a CSV containing up to 1M contacts or 5GB of data, whichever is less. </call-out> 1. Use [this CSV template]({{root_url}}/assets/example.csv) to make sure your CSV is formatted correctly. 1. Click **Add Contacts** and then select **Upload CSV**. 1. Choose whether to add your contacts to All Contacts, to an existing list, or to a new list you create. 1. Upload your file by dragging it into or clicking the CSV upload area and selecting a file from your computer. 1. Click **Next: Review CSV Upload**. 1. On this page, all fields are listed and you can see which fields don't have a corresponding reserved or system field. 1. For each unmapped field, select a custom field from the drop-down or to create a new custom field, click **Create New Custom Field**. 1. When you're done mapping the fields, click **Next: Add Contacts**. Once the CSV has processed, you will receive a [notification]({{root_url}}/ui/account-and-settings/notifications/) email. ### Add Manually You can add your contacts manually including alternate email addresses, addresses and names from the Contacts page. 1. Navigate to **Marketing** and then click **Contacts**. 1. Select **Add Contacts** and then click on **Manual Add** in the drop down menu. 1. Choose whether to add your contacts to All Contacts, to an existing list, or to a new list you create. 1. Add your contact's email, and then any other information you may have. 1. When you're done, click **Add Contacts**. ### Create a signup form You can use [Signup Forms](https://mc.sendgrid.com/forms/signup) to capture new contacts and add them directly to Marketing Campaigns. You can embed your forms directly into webpages using an [\<iframe\>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe). Forms can also be shared using a Twilio SendGrid-hosted link, making them a great way to grow your lists by engaging customers wherever they are. You can create as many as 15 Signup Forms, allowing you to deploy lists and segment contacts in the ways that best suite your business needs. <call-out> If you add contacts using a list that's acting as the entry criteria for a live automation, the new contacts will automatically receive any emails you’ve created as part of that automation. </call-out> _To create a new signup form:_ 1. Navigate to Marketing and select **Signup Forms**. 2. Click **Create a Signup Form**. ![The Signup Forms page with a "Create a Signup Form" button]({{root_url}}/img/signup_form_create.png 'Create a Signup Form') 3. A page will load with configuration tabs and a preview of the form. On the **Settings** tab, add a **Form Name**. 4. You can populate the **Add contacts to** field with any of your contacts lists, including **All Contacts**. 5. Next, add a **Confirmation Message**. This field contains the text that contacts will see once they’ve submitted the form. ![The Signup Forms page with the Settings tab open]({{root_url}}/img/signup_form_settings.png 'Signup form settings') 6. Navigate to the **Build** tab to add fields to the form itself. - The **Build** tab allows you to label your form by setting a **Header**. You can also add any **Intro Copy** that might help customers understand the purpose of your form. - The **Build** tab also provides the opportunity to add [Reserved Fields]({{root_url}}/ui/managing-contacts/custom-fields/#reserved-fields) and [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) to the form. This means you can collect helpful information about new contacts at the time of signup. Expand the **Reserved Fields** and **Custom Fields** menus, and select any fields you want to include — they will appear in the form preview beside the **Build** tab. ![The Signup Forms page with the Build tab open. Two custom fields are selected and showing in the form preview.]({{root_url}}/img/signup_form_build.png 'Signup form build') <call-out> If a contact (defined by a unique email address) already exists in your contact database, any new or updated data will be reflected on that existing contact. </call-out> 7. You can change the look of your form using the **Styles** tab. In addition to modifying fonts and colors, you can change the button styles and the width of the form. 8. Once you are happy with the form, select **Save & Apply**. ### Share Code to make your form accessible Once your form has been created, you can share it by embedding it into your own webpages or by providing customers with a direct link to the form. The link is hosted by Twilio SendGrid. If you choose to embed your form, it will be hosted in an `<iframe>`. _To share the code for your signup form:_ 1. Navigate to the signup form you want to share or embed. 2. Click the action menu and select **Share Code**. ![The action menu (three dots) open with the "Share Code" menu item highlighted]({{root_url}}/img/signup_form_share_code_action_menu.png 'Action menu Share Code') 3. A modal will open where you can copy either the direct link to the Twilio SendGrid-hosted form — titled, **Landing Page** — or the embeddable `<iframe>` code — titled, **Direct Embed**. - The Landing Page link can be pasted anywhere, including in an email or on a social media site. - The Direct Embed code can be pasted into the HTML of your website wherever you want to display the form. ![The signup form's share modal]({{root_url}}/img/signup_form_share_code_options.png 'Form share options') You can also find the options to share the signup form in the form editor by clicking **Share Code** in the top right corner of the editor. ### Manage signup forms Using the action menu on the Signup Forms page you can edit, duplicate, or delete existing signup forms. ![]({{root_url}}/img/action-menu-signup-form.png 'Action menu for signup forms') <call-out> Because of the `<iframe>` technology used to create the signup form, the form dynamically updates on the page or pages where you have the form embedded anytime you edit a form and click **Save & Apply**. </call-out> ## Manage Contacts Managing contacts is an integral part of your Marketing Campaigns lifecycle. You can create lists for contacts, as well as view and edit each individual contact within your contact database. ### Viewing a contact To view a specific contact profile, find the contact in one of your lists by searching your contact database. Then, click the contact’s email address. You will then be able to view the email, engagement data, profile information, custom fields, and list associations for this contact. <call-out> Searches are case agnostic but must be done using a whole email address that includes an "@" and any top-level domain like ".com" or ".io". </call-out> To view any custom fields you have assigned to this contact, or to view any lists that you have added this contact to, you may flip through the tabs beneath the Contact Details. You may either view all custom fields at once, or you can filter them by the following types: “Text”, “Date”, and “Number”. ### Editing a contact When you are viewing a contact, click any of the Edit buttons in the Contact Fields tab to edit the contact's information within that section. This includes the Twilio SendGrid provided reserved fields, except email, any custom fields you’ve added for this contact, and any lists the contact is associated with. _To edit the associated lists for your contact:_ 1. Select the **Associated Lists** tab. 2. Enter or select the list you would like to use. 3. Click **Add**. ### Managing your list Sending to a well-managed address list can drastically improve your delivery. We have put together some simple steps and guidelines that will improve any senders list. - [Suppressions](#identifying-suppressions) - [Delete unusable contacts](#delete-unusable-contacts) - [Delete a specific contact](#delete-a-specific-contact) - [Delete all contacts](#delete-all-contacts) ### Identifying Suppressions In your Twilio SendGrid Account are different [Suppressions]({{root_url}}/ui/sending-email/index-suppressions/) lists. **Global Unsubscribes** - Addresses on this list are opted out of all mail. **Bounces** - Addresses that have failed to deliver to the recipient's inbox. Once an address has been added to this list, we do not attempt to deliver further messages to it. We will instead Drop them to protect your external reputation. **Spam Reports** - Addresses that have marked your mail as spam. **Blocks** - Addresses that have blocked your mail temporarily, usually due to factors like a denied IP address. You can attempt to resend to these addresses. **Invalid** - Addresses on this list are malformed and do not have a valid email address structure. (Ex. info.sendgrid.com, info@sendgridcom, info @ sendgrid.com) Emails sent to addresses listed in the Bounce, invalid, Spam, and Unsubscribe list are automatically dropped by Twilio SendGrid. Feel free to remove these addresses from your lists to save money and time. ### Delete unusable contacts It is common to have contacts that result in a group unsubscribe, block, bounce, invalid email address, or spam report. Attempting to send email to these contacts can negatively impact your reputation since these contacts do not want to (and will not) receive your marketing emails. _To remove all of your unusable Marketing Campaigns contacts:_ 1. When viewing your dashboard, navigate to the left-hand menu and click **Suppressions**. 1. Open a specific group, such as Bounces or Spam Reports, click the action menu in the upper right corner, then select **Download as CSV**. 1. Repeat step 2 for each of the groups that you want to remove (unsubscribes, spam reports, etc.) and merge each of those lists into a single CSV file. 1. Return to your dashboard, navigate to the left-hand menu and select **Marketing**, then **Contacts**. 1. In the upper right corner click **Add Contacts** and select **Upload CSV**. 1. Select **Create New List** and name it something obvious, like "Remove Invalid Emails." 1. Once uploaded, click the action menu to the right of that new list and select **Delete**. 1. Check the box indicating to delete "all contacts associated with this list." ### Delete a specific contact <call-out type="warning"> There are two methods to delete contacts; one in which only a specific list or segment will be deleted and the contacts will _remain_ in All Contacts, and the second in which you can delete a list or segment and ALL associated contacts. </call-out> <call-out type="warning"> When you delete a contact, all stats related to that contact will also be removed. </call-out> _To remove a list or segment, but keep the contacts in All Contacts:_ 1. Navigate to your list or segment. 2. Click the checkbox to the left of your list or segment. 3. Click # selected dropdown and delete. _To remove a list or segment, and ALL associated contacts:_ 1. Navigate to your list or segment. 2. Hover over the Action menu to the right of the list or segment. 3. Click on the trash icon. 4. Check the box "Delete all contacts associated with this list from my account." 5. Select delete. _To remove one or more contacts from a list:_ 1. Navigate to the [All Contacts list](https://sendgrid.com/marketing_campaigns/ui/all_contacts). 1. Search for the contact you want to delete. 1. Click **delete** to remove the contact permanently. <call-out type="warning"> Use this to permanently delete your recipients from all of your contact lists and all segments if required by applicable law. </call-out> ### Delete all contacts _To delete all of your contacts at once:_ 1. Navigate to your Contacts page and hover over the Action Menu next to All Contacts. 1. Click the trash can icon. 1. Select the checkbox to confirm that you want to delete all contacts and then click **Delete**. ### Edit or Remove Contacts from a list To manage your contact lists more efficiently, you can edit and remove contact lists from the Contacts page. _To edit a contact:_ 1. Navigate to the Contacts page and search for the contact you want to edit. 1. Click the contact you wish to edit. This takes you to the contact details page. 1. To edit any of the profile fields, click on the _Edit_ icon to the right of the field. 1. Once you have finished making all of your changes, click **Save**. _To delete a contact from your account:_ 1. Navigate to the Contacts page and search for the contact you want to edit. 1. To delete a contact from the contact list, you can click the delete icon in the action menu. To delete a contact from the contact details page, click the delete icon at the top-right of the page. 1. If you are deleting the contact from a specific list, and not All Contacts, click **Remove Contact**. If you are deleting the contact from the account, select **Permanently delete this contact from my account**. _To remove a contact from a list:_ 1. Navigate to the Contacts page and search for the contact you want to edit. 1. Click the email of the contact to view contact details. 1. Click the Associated Lists tab from the contact details page. 1. Find the list you want to remove the contact from and click the delete icon. 1. When you see "Are you sure you want to remove this contact?" click **Remove Contact**. <call-out> Contacts that are deleted from your SendGrid account are removed compliantly, according to GDPR. [Click here](https://sendgrid.com/resource/general-data-protection-regulation-2/) for more information on GDPR. </call-out> ## Export contacts To view the contents of a contact list, you can export the list to a CSV and download it to your computer. _To export contacts:_ 1. Navigate to the Contacts page within the Automation Beta experience. 1. Locate the contact list you want to export and click the action menu. 1. Select **Export**. The Export page appears with a list of all current and previous exports. 1. From here you can find the exported contact list and select the action menu. 1. Select the **Download CSV** icon next to the list to download the contact list to your computer. <call-out type="warning"> Exported CSV files are only available for download for 72 hours after the export is initialized. </call-out> ## Contact Management APIs You can integrate with the Contact Management APIs to create and update lists, add contacts, manage reserved field data, export contact lists, and pull data about your contacts and lists. Learn more through the documentation for the [Marketing Campaigns Contact APIs](https://sendgrid.api-docs.io/v3.0/contacts/). ## Additional Resources - [Custom Fields]({{root_url}}/ui/sending-email/editor/) - [Formatting a CSV]({{root_url}}/ui/managing-contacts/formatting-a-csv/) ================================================ FILE: content/docs/ui/managing-contacts/custom-fields.md ================================================ --- layout: page weight: 55 title: Using Custom Fields group: managing-contacts navigation: show: true seo: title: Using Custom Fields keywords: Custom Fields, Personalization, customized email override: true description: Custom fields help you segment your lists dynamically based on your user information. --- <call-out> This page is describing the functionality of the new Marketing Campaigns experience, if you're using legacy Marketing Campaigns, your workflow and screens may be a little different. For more information on the new Marketing Campaigns experience click [here](https://sendgrid.com/pricing). </call-out> <iframe src="https://player.vimeo.com/video/375994906" width="640" height="480" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> Custom Fields allow you to add extra information about a contact within your contact database when you upload a CSV. You can use custom fields to create dynamic [segments]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) or to personalize the subject lines or content of Marketing Campaigns emails you send. Your custom fields are completely customizable to the use cases and user information that you need. <call-out> You can create up to 120 custom fields. </call-out> ## Creating Custom Fields _To add a custom field:_ The most common way to add custom fields is by including each custom field you’d like to add as a column in your CSV [upload]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#uploading-a-csv). If you’d like to add custom fields programmatically, see our [API documentation](https://sendgrid.api-docs.io/v3.0/custom-fields/create-custom-field-definition) You can also add custom fields manually from the Custom Fields page. 1. Navigate to the Custom Fields page and click **New Custom Field**. 1. Add a _Field Name_ and select a _Field Type_. 1. Click **Create Field**. The field name should be created using only alphanumeric characters (A-Z and 0-9) and underscores (\_). Custom fields should only begin with letters A-Z or underscores (\_). The field type can be `date`, `text`, or `number` fields. The field type is important for creating segments from your contact database. **Note:** If you have created a custom field that begins with a number, you will need to recreate it with a name that begins with letters A-Z or an underscore (\_). <call-out type="warning"> Custom fields that begin with a number will cause issues when sending with Marketing Campaigns. </call-out> You can create three different types of custom fields, based on the data type. Each data type will allow you to use different queries for segmentation: - **Date** - allows you to select contacts before, after, or on a specific date. _Example: 1/1/2014_ - **Text** - allows you to select contacts who match the specific text. _Example: Pet field that says "Dog"_ - **Number** - allows you to do things like “greater than,” “less than,” or “equals” a specific number. Both decimal and integer values are accepted. _Example: The age of your recipient: 27_ <call-out type="warning"> Text custom fields are limited to 1,000 characters. </call-out> ### Reserved Fields Your account comes preloaded with unremovable reserved fields. The following field names are all reserved: <table class="table"> <tr><th>Field Name</th><th>Field Type</th></tr> <tr><td>first_name</td><td>text</td></tr> <tr><td>last_name</td><td>text</td></tr> <tr><td>email</td><td>text</td></tr> <tr><td>alternate_emails</td><td>text</td></tr> <tr><td>address_line_1</td><td>text</td></tr> <tr><td>address_line_2</td><td>text</td></tr> <tr><td>city</td><td>text</td></tr> <tr><td>state_province_region</td><td>text</td></tr> <tr><td>postal_code</td><td>text</td></tr> <tr><td>country</td><td>text</td></tr> <tr><td>phone_number</td><td>text</td></tr> <tr><td>whatsapp</td><td>text</td></tr> <tr><td>line</td><td>text</td></tr> <tr><td>facebook</td><td>text</td></tr> <tr><td>unique_name</td><td>text</td></tr> </table> SendGrid auto-populates 6 reserved fields: `lists` `created_at` `updated_at` `last_emailed` `last_clicked` `last_opened` Reserved fields are used by default to track useful metrics for your contacts. ## Deleting a Custom Field _To delete a custom field:_ 1. Navigate to **Marketing** and select **Custom Fields**. 1. Locate the field you wish to remove. 1. Hover over the action menu to the right of the field name entry. 1. Select the delete icon. 1. Click **Delete Field**. This deletion process may take several minutes; you will continue to see the custom field on this page until the process completes. <call-out type="warning"> Deleting a custom field deletes all values for that field across your contact database. It will also break Single Sends or Automation emails using the custom field as a tag or segments using the field as a condition. See below for details. </call-out> If a deleted custom field is **used as a tag within a Single Send or Automation email** as part of the subject line or body copy, the email will send with the default value you've designated or the fall back "default". If you have deleted the fallback, the email will not display anything at all in place of the deleted custom field. If a deleted custom field is **used as criteria within a segment** the segment will fail to load. Neither Single Sends nor Automation emails will be able to be sent to the segment using the deleted custom field. ## Troubleshooting If a custom field value does not appear in the corresponding [Substitution Tag]({{root_url}}/ui/sending-email/editor/#using-substitution-tags), make sure that there is a value for that custom field associated with the contact in your contact database. If there is no value for a particular custom field, a space will be substituted instead. If you do find that the custom field has an associated value on the contact’s profile page, check the spelling of the substitution tag in the content of your campaign. ## Additional Resources - [Substitution Tags]({{root_url}}/ui/sending-email/editor/#using-substitution-tags) - [Contacts]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/) - [Segmenting your Contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) ================================================ FILE: content/docs/ui/managing-contacts/email-address-validation.md ================================================ --- layout: page weight: 55 title: Email Address Validation group: managing-contacts navigation: show: true seo: title: Email Address Validation keywords: email, validation, signup override: true description: Twilio SendGrid's real-time Email Address Validation provides you detailed information on the validity of your users' email addresses, as well as allows you to integrate this validation process into your signup process. --- Email Address Validation provides real-time detailed information on the validity of email addresses. You can integrate this validation process into your platform's signup form and customize the best use of email address validation for your use case: - Identify a validation threshold from which you feel comfortable sending a follow up email - Display to your form visitors that their email addresses are likely invalid within your form - Decide if you want to drop invalid email addresses from your database. Validating email addresses allows you to to suppress invalid email addresses from your sending, decreasing your bounce rate, cleaning your subscriber list, ultimately improving your sender reputation. ## Generating your Email Validation API Key Before you can call the Email Address Validation Real Time API endpoint, you’ll need an API key with Email Address Validation permissions. <call-out> You are required to create a brand new API key that will only be used for Email Address Validation. The Email Validation dashboard will appear in the SendGrid UI for the user that creates the Email Validation API Key. </call-out> 1. Navigate to **Settings**, and then select **API Keys**. Click **Create API Key** in the upper right-hand corner. 1. Name your new key and select the **Email Address Validation Access** permission. 1. Select **Full Access** to the left of **Validation**. ![]({{root_url}}/img/create-api-key.png "API Key Access Permissions List") <call-out> “Email Address Validation Access” will be visible to Email API Pro and Premier plans only. </call-out> 4. Click **Create & View**. 5. Copy your new API key somewhere safe. **This will be the only time you will be able to see it in its entirety due to security reasons.** You’re now ready to start using the [Real Time API endpoint!](https://sendgrid.api-docs.io/v3.0/email-address-validation/validate-an-email) 
 ## Recommendations Before Integrating The Email Address Validation Real Time API Endpoint takes a single email address in a POST request, and returns a verdict with detailed data in a JSON response. Complete documentation of the endpoint, including details of the response, are available [here](https://sendgrid.api-docs.io/v3.0/email-address-validation/validate-an-email). When integrating with the Email Validation API endpoint, please keep the following things in mind: - Do not call the API endpoint from client side code such as Javascript. Doing so would allow anyone to find your API key and use it to validate their own email addresses on your account. You should instead call the API from backend code, for instance, after the user submits a form. - The API currently accepts one email address at a time. If for some reason you have multiple addresses you need to validate, please call the API once per email address. We do not currently have a batch API. - If you choose to integrate into a signup form we recommend ensuring the Email Validation API is not a blocker for your form submissions. - The API endpoint is rate limited to 7 requests per second. The "Source" gets passed through the API call as an optional field to identify the source if you choose to integrate with multiple email address captures and want to be able to compare their results. You pass it as a string, only using alphanumeric characters and spaces. For example: ``` { "email": "email@example.com", "source": "Newsletter Signup" } ``` The API response should look something like this, using the example email "cedric.fogowl@gmail.com": ``` {"result":{"email":"cedric.fogowl@gmail.com", "verdict":"Valid","score":0.98015, "local":"cedric.fogowl","host":"gmail.com", "checks":{"domain":{"has_valid_address_syntax":true, "has_mx_or_a_record":true,"is_suspected_disposable_address":false}, "local_part":{"is_suspected_role_address":false}, "additional":{"has_known_bounces":false, "has_suspected_bounces":false}},"ip_address":"65.101.243.157"}} ``` There is a limit of 50 sources. Sources are automatically deleted once the last validation to use that source falls off the 30 day window. You can continue to make validations without a source if you’ve hit the limit. ### Options for Integration The Email Validation API allows flexibility for integrating in multiple ways, but for simplicity we'll focus on validating emails in a signup form. A signup form is anywhere you are capturing email addresses. This could be a lead capture signup form like requesting a content piece or an account signup. Once you identify the signup form you want to integrate with the Email Validation API, next you need to decide if you want to use validation results to surface possible typos to form visitors while they're still in the form or capture the results after the form submission to inform sending decisions. The first option is to provide user feedback by returning to the sign up form and showing an inline error, letting the user know that they need to check the email address. For instance, you might realize the user made a typo as described in the previous section and decide to show an error like, “Did you mean john.doe@gmail.com?” <call-out type="warning"> Be careful not to create a block in your sign up form if you provide user feedback. It’s possible that a user’s actual email address doesn’t meet your criteria for a good address, and will never be able to successfully submit your form. You should consider alerting the user only once, and then allowing the same address if they submit it again a second time. </call-out> The second option is to validate the email address after submission and not provide any user feedback. You can then use the Email Validation results to decide what email addresses you feel comfortable sending email to. Depending on your business needs and how you prefer to integrate, both of these approaches are great options. The upside of providing user feedback in the signup form is that you’ll catch visitor typos before they leave the form, however the downside is that you’ll still have some friction points in the signup form in the event that the address they provide doesn’t meet your criteria. The upside of dropping bad addresses in the backend is that you have a frictionless signup form, while the downside is you lose the opportunity to save contact with visitors who may have accidentally mistyped their email address. ### Email Validation Results The API response you receive after calling the API contains a lot of useful information that you can use to determine whether or not you want to accept or send to an email address. Below is a summary of the three most important fields you’ll want to look at: - **Verdict**: This field will contain one of three categories: `“Valid”`, `“Risky”`, or `“Invalid”`. These are generic classifications based off of the detailed results. You could filter off of this field if you want to go off of our suggestion, but you could also look at more detailed information like the next 2 listed. - **Score**: This number from 0 to 1 represents the likelihood the email address is valid, expressed as a percentage. So for instance, a score of 0.96 could be interpreted as a 96% likelihood the email is valid. If you want finer grained control than the generic categories of the `“result”` field, you could set a threshold based off this score. - **Checks**: This field will contain a list of all the checks that ran on the email address. You could use these results to determine if you want to take a calculated risk in sending to an address. For instance, an email address that is a role address (e.g. admin@examplecompany.com) will come back with a `“Risky”` result and a score of 50%. A disposable email address from mailinator.com would also come back with a `“Risky”` result and a score of 50%. You might decide that you only want to send to email addresses with a score of 80% or higher, but are also OK with sending to addresses that are disposable (and therefore have a score of 50%). You could use this field to gain the info you need to filter at that level. Here are a list of all the checks and what they mean: - ``has_valid_address_syntax`` - If true, then the address is a properly formatted email address (e.g. it has an @ sign and a top level domain). If false, then it’s a malformed address. - ``has_mx_or_a_record`` - If true, the domain on the address has all the necessary DNS records to deliver a message somewhere. If false, the domain is missing the required DNS records and will result in a bounce if delivered to. - ``is_suspected_disposable_address`` - If true, the domain part of the email address appears to be from a disposable email address service, in which the addresses are only good for a short period of time. - ``is_suspected_role_address`` - If true, the local part of the email address (before the @ sign) appears to be a group email address such as “hr” or “admin”. - ``has_known_bounces`` - If true, the email address has previously been sent to through your SendGrid account and has resulted in a bounce. - ``has_suspected_bounces`` - If true, our machine learning model suspects that the email address might bounce. You can use any combination of these fields to filter down to what you consider a good address. ## Suggestions for domain typos The Email Validation Real Time API will check for typos in an email address in addition to evaluating its validity. If we detect a possible typo, you will find a `“suggestion”` field in the API response containing what we believe to be the correct domain. For instance, if you call the API with “john.doe@gmial.com”, the API response might look something like this: ``` { "result": { "email": "john.doe@gmial.com", "verdict": "Invalid", "score": 0.00089, "local": "john.doe", "host": "gmial.com", "suggestion": "gmail.com", "checks": { "domain": { "has_valid_address_syntax": true, "has_mx_or_a_record": true, "is_suspected_disposable_address": false }, "local_part": { "is_suspected_role_address": false }, "additional": { "has_known_bounces": false, "has_suspected_bounces": true } }, "ip_address": "123.45.67.89" } } ``` In this response, the `“suggestion”` field is recommending “gmail.com” instead of “gmial.com.” With this info, you can combine the value in the “local” field with the value in the `“suggestion”` field to create the intended email address of “john.doe@gmail.com.” ## Email Validation API Dashboard <call-out> The Email Validation dashboard will only appear in the SendGrid UI for the user that creates the Email Validation API Key. </call-out> The last way you can evaluate your validation results is in the [Email Validation API dashboard](https://app.sendgrid.com/email_validation) within the SendGrid UI. This Validation dashboard gives you access to all the validation results you’ve done in the past 30 days, and allows you to filter down to what you consider a good address. You can filter by the verdict result, the source the validation was performed at, as well as the score. ![]({{root_url}}/img/email-address-validation-stats.png "Email Address Validation Statistics") ### Detailed validation results You can select a specific email address within the Email Validation API dashboard in order to view the detailed validation results for that email address. ![]({{root_url}}/img/validation-details.png "Validation Details") ### Exporting your results Once you’ve filtered down to your desired list of results, you can click the **Export CSV** button to get a CSV list of your results. This can then be used to upload your good contacts and validation results to Marketing Campaigns, or your database or CRM of choice. ================================================ FILE: content/docs/ui/managing-contacts/formatting-a-csv.md ================================================ --- layout: page weight: 80 title: Formatting a CSV group: managing-contacts navigation: show: true seo: title: Formatting a CSV keywords: Marketing Campaigns Contacts, CSV, Contact Information, Contacts override: true description: Directions on how to format a CSV for upload using SendGrid Marketing Campaigns --- <call-out> The content on this page describes the experience in the latest version of Marketing Campaigns. If you’re using the legacy version of Marketing Campaigns, your experience may be different. To explore Marketing Campaigns plans and upgrade, click [here](https://sendgrid.com/pricing). </call-out> You can add contacts to your contact database by uploading a CSV into Marketing Campaigns. If you have your contacts in a spreadsheet, save that sheet as a CSV file using a spreadsheet application like Microsoft Excel or Google Sheets. You can also export your contacts from most database systems as a CSV file. ## General Formatting Rules Follow the rules below when formatting a CSV to upload into Marketing Campaigns. Click [here]({{root_url}}/assets/example.csv) to download a sample CSV like the one shown below: ![]({{root_url}}/img/example-csv.png "Example of a CSV with proper formatting") ### Contact Info Your CSV should contain the following information about each contact: * email (required) * first_name * last_name In addition to `email`, `first_name`, and `last_name`, there are also several other [reserved fields]({{root_url}}/ui/managing-contacts/custom-fields/#reserved-fields) such as `city` and `zipcode`. You can also include [custom fields]({{root_url}}/ui/managing-contacts/custom-fields/) with additional identifying information for each contact in the CSV. For example, you could specify `birthday`, `occupation`, and `age` as the custom fields. The data in the custom fields are critical for both segmentation and content personalization. ### Header Row The first row of your CSV must be a header row containing labels identifying each column. Headers should only use letters, numbers, and underscores. Header fields can be blank in your CSV, but must be named and have their type defined later during the upload process. <call-out> You cannot use spaces, dashes, or other special characters, except for underscores in a CSV. </call-out> If you add custom field data to your CSV, you can save some time when uploading by naming the columns the same as the custom fields you have previously defined. SendGrid identifies individual contacts by their email address, so one of the CSV headers must be `email`. If you do not include the email column, SendGrid will not add any information to your contact database or list. Rows in your CSV without an email address in the email column will automatically fail to add to your contact list, but they will not cause the entire upload to fail. ### Character Encoding If your contacts list has non-English characters, please make sure that you are UTF-8 encoding your CSV file. ### Removing invalid and duplicate addresses SendGrid removes duplicate and invalid email addresses including email addresses with any special characters except for underscores from your list during upload, so the number of contacts can potentially change between your CSV and your Marketing Campaigns list. ### Numbers and Text Format your text fields so that there are no strings of numbers that appear like phone numbers, zip codes, and so on. They should not contain punctuation characters like a dash, underscore, parenthesis, or multiple dots. ``` - US Zip Code: 80202-1713 - Phone numbers: "(555) 555-5555" or "555.555.5555" - Monetary Values with the currency indicator such as $3.50 or €5.73 ``` ### Date Formatting Properly format any dates in your CSV. If you create your CSV with Excel and it is not displaying correctly, change the date format to display appropriately before exporting to CSV. Use one of the following date formats: `MM/DD/YYYY, MM/D/YYYY, M/D/YYYY, or M/DD/YYYY`. ### Troubleshooting Below are a few errors you may encounter when uploading a CSV to Marketing Campaigns, along with tips to correct the root issue. **We were unable to detect an email column in the CSV file headers. The email column must always have a header of "email"**. - If there is a header labeled "email" try moving it to column A, so it is the first header in your list. - Your CSV _must_ include an email header. ![Move email header to column A]({{root_url}}/img/listupload_1.png) **Some of your custom fields have not been selected**. - Look for hidden characters in your CSV file if you have worked with the file multiple times and made some adjustments to the data. - A common fix for this error would be to select all and copy your data to a new CSV spreadsheet. This should remove any hidden characters. ![]({{root_url}}/img/listupload_2.png) **Each custom field can only be applied to a column once. Please check your columns and try again**. - Check your CSV for duplicate fields, especially fields that have matching information as your `email`, `first_name` and `last_name` fields. You cannot edit these field names as they are reserved. - For example, if you have a "Name" field, it may conflict with your `first_name` reserved field. ![]({{root_url}}/img/listupload_3.png) **We were unable to detect any headers in your CSV file**. - Include headers at the top of each column. All CSV uploads must contain the "email" header. Header fields can be blank in your CSV but must be defined later during the upload process. ![]({{root_url}}/img/listupload_4.png) **Float type conversion error**. - Categorize dashes or decimal places that are past the hundredth place as text_fields (-100, 123.123 are text fields, 100, 12.12 can be number fields). - Number fields can include monetary values without the currency symbols. For example, 19.95 would be a number field, and $19.95, including the ($), would be a text field. - As you are uploading your CSV, make sure you select the correct fields for your Field type. ![]({{root_url}}/img/listupload_table.png) ## Additional Resources - [Contacts API](https://sendgrid.api-docs.io/v3.0/contacts/) - [Segmenting your Contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) - [Building your Contact list]({{root_url}}/ui/managing-contacts/building-your-contact-list/) ================================================ FILE: content/docs/ui/managing-contacts/segmenting-your-contacts.md ================================================ --- layout: page weight: 70 title: Segmenting your Contacts group: managing-contacts navigation: show: true seo: title: Segmenting your Contacts keywords: Segmentation, email segmentation, targeted marketing, email, marketing campaigns override: true description: --- <iframe src="https://player.vimeo.com/video/385360784" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> <call-out type="warning"> The content on this page describes the experience in the latest version of Marketing Campaigns. If you’re using the legacy version of Marketing Campaigns, your experience may be different. To explore Marketing Campaigns plans and upgrade, click [here](https://sendgrid.com/pricing). </call-out> [Segments]({{root_url}}/glossary/segmentation/) are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience. <call-out> Marketing Campaigns supports up to 200 segments per user. </call-out> [Custom fields]({{root_url}}/ui/managing-contacts/custom-fields/), [reserved fields]({{root_url}}/glossary/reserved-fields/), and engagement data like opens and clicks, provide unique information you can use to identify contacts for different segments. As your contacts' traits change or you add more contacts that meet the criteria of your segment, your segments will update to reflect these changes. For example, a segment populated using the criteria, “lives in Denver” or, “is under 30 years old” will change as your contacts age or their addresses change. Segments can pull from _All Contacts_ or any of your more narrowly defined lists. ## How segments work Segments are created by comparing your contacts against criteria you define. If a contact matches the specified criteria, they will be included in your segment. Engagement data such as "opened" or "clicked" will add contacts who have _engaged_ in this behavior with one of your messages. Whether or not a contact meets your defined criteria is evaluated using the combination of conditions you create. Each condition consists of three parts: fields, operators, and values. The first part of the condition, the field, is the data _field_ you want to filter your contacts by. Fields include traits such as "First Name," "Email," or "City" and engagement data such as "Last Clicked." For a full list of available fields, see the [Segmentation fields and types tables](#segmentation-fields-and-types). Operators are the second part of the expression, and they define how your contacts should be evaluated. All fields have a data type assigned to them (text, number, date, Single Send); this type will determine which operators are available. For example, "Last Clicked" is a date field, and it has date operators such as "is after" and "is before" available. For a full list of operators available by field type, see the [Operators available by field type section](#operators-available-by-field-type). The last part of the expression is a value. The value is compared to the field using the operator. For example, you may select the field, "City." City is a text-type field, so you can then choose "is" from the available operators for that field type. You can then add the value, "Denver." This expression will check your contacts for entries who live in Denver and include all who do in your segment. You can build precisely targeted segments by using multiple conditions to filter your contacts. The previous example is among the simplest segments possible using Marketing Campaigns. ## Creating a segment with Marketing Campaigns To create a segment, login to the Twilio SendGrid App and complete the following steps. 1. Navigate to [**Marketing** and then select **Contacts**](https://mc.sendgrid.com/contacts). 2. Click on the **Create** dropdown button, and then the **New Segment** option. ![The SendGrid App with the Create dropdown extended and "New Segment" highlighted in the dropdown.]({{root_url}}/img/new_segment_dropdown.png 'Create dropdown') 3. Enter a _Segment Name_. 4. Choose **Segment all contacts** or **Segment an existing list**. ![The contacts menu inside the SendGrid App, displaying the segment name field and list from which a the segment should be built.]({{root_url}}/img/create_new_segment.png 'Create a new segment') <call-out> If you're segmenting an existing list, you can click the action menu to the right of the list name from the [Contacts page](https://mc.sendgrid.com/contacts) and select "Create Segment" directly. </call-out> 5. To segment an existing list, select a list from the **Existing List** drop-down. 6. In the **Who are you targeting?** section, start building your first condition by choosing a _field_ from the drop-down. 7. Choose from the list of available _operators_. 8. Enter the desired _value_ you want to segment by. 9. You can [add multiple conditions](#adding-multiple-conditions-with-a-segment) and choose to join them with **AND** or **OR**. **AND** will require both conditions to be true; **OR** will qualify a contact for whom _either_ condition is true. This functionality allows you to further refine your segments to target your audience with precision. <call-out type="warning"> Segments can have one Email Activity, Single Send, or Automation condition field each. These can be combined with custom field and reserved field conditions. </call-out> 10. Once you are finished adding conditions, click **Save Segment**. ![The segment builder inside Marketing Campaigns, displaying a new segment with a City condition set to "Denver" and a State, Province, Region condition set to "Colorado".]({{root_url}}/img/create_new_segment_two_fields.png 'Create a new segment with two fields') Once your segment is processed, you will see a count of all contacts who meet your segment conditions, as well as a sample of these 50 contacts. To see all contacts included in your segment, click **Export CSV** to download a complete file. <call-out type="warning"> Segments built using engagement data such as "was sent" or "clicked" will take approximately 30 minutes to begin populating. </call-out> ## Segment refresh cadence Contacts will be added to or removed from your segment as they meet or no longer meet the conditions of your segment. This can be driven by: - New contacts being added to or updated within Marketing Campaigns, whether via CSV upload, API integration, Signup Forms, or manual changes. - Contact engagement behavior, such as opening or clicking an email in a way that’s relevant to your segment conditions. - A change you make to the conditions that define your segment. Typically, existing contacts who meet your criteria will begin to appear in your segment searches within 15 minutes. You can see all contacts who are included in the segment at any given time by clicking **Export CSV**. Segments are pulled at the time of an export; this means that an exported CSV will reflect a near-real-time segment population. To check for a specific contact, you can search by the contact’s email address. <call-out> Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment **searches** within 15 minutes. </call-out> <call-out type="warning"> Segments built using engagement data such as "was sent" or "clicked" will take approximately 30 minutes to begin populating. </call-out> Segment **samples** and **counts** are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours. You can see an estimate of the next scheduled segment refresh on the [**Contacts**](https://mc.sendgrid.com/contacts) page as well as on the detail page of your segment. ![The Contacts landing page in the Marketing Campaigns App]({{root_url}}/img/mc-contacts-segments.png 'Marketing Campaigns Contacts Page') ![A segment detail page with a tool tip indicating the next estimated refresh time]({{root_url}}/img/mc-segment-refresh.png 'Marketing Campaigns segment detail page refresh estimate') Automations with entry criteria of a contact entering a segment will be triggered according to the same schedule as the segment sample refresh cadence described above. However, when you send a Single Send to a segment, Marketing Campaigns will pull the segment at the time of send, reflecting the near-real-time segment population. <call-out> Marketing Campaigns will pull a segment at the time of send, reflecting the near-real-time segment population. </call-out> ## Segmentation fields and types The following tables list the available reserved fields and the fields' data types. Reserved fields are present in your account by default. Your account will also include any Custom Fields you add. The operators available for each type are included in the [section following these field tables](#operators-available-for-contact-profile-and-custom-fields). ### Contact Profile fields <table class="table auto"> <tr> <th>Field Name</th> <th>Field Type</th> </tr> <tr> <td>First Name</td> <td>Text</td> </tr> <tr> <td>Last Name</td> <td>Text</td> </tr> <tr> <td>Email</td> <td>Text</td> </tr> <tr> <td>Address Line 1</td> <td>Text</td> </tr> <tr> <td>Address Line 2</td> <td>Text</td> </tr> <tr> <td>City</td> <td>Text</td> </tr> <tr> <td>State Province Region</td> <td>Text</td> </tr> <tr> <td>Postal Code</td> <td>Text</td> </tr> <tr> <td>Country</td> <td>Text</td> </tr> <tr> <td>Date Added</td> <td>Date</td> </tr> <tr> <td>Last Updated</td> <td>Date</td> </tr> </table> ### Email Activity fields <table> <tr> <th>Field Name</a></th> <th>Field Type</a></th> </tr> <tr> <td>Last Clicked</td> <td>Email Activity*</td> </tr> <tr> <td>Last Opened</td> <td>Email Activity*</td> </tr> <tr> <td>Last Emailed</td> <td>Email Activity*</td> </tr> </table> ### Single Send fields <table> <tr> <th>Field Name</a></th> <th>Field Type</a></th> </tr> <tr> <td>Single Send Activity</td> <td>Single Send**</td> </tr> </table> ### Automations fields <table> <tr> <th>Field Name</a></th> <th>Field Type</a></th> </tr> <tr> <td>Automation Activity</td> <td>Automation**</td> </tr> </table> \* Email Activity fields have their own Email Activity type. After selecting one of [the operators available for this type](#operators-available-for-email-activity-fields), you'll define the time period in which the engagement occurred. \*\* Single Send Activity and Automation Activity fields have their own Single Send and Automation types. After selecting one of [the operators available for these types](#operators-available-for-single-send-fields), you'll choose whether the operator applies to any Single Send or Automation or to a specific Single Send or Automation. You will then define the time period in which the engagement occurred. ### Operators available for Contact Profile and Custom Fields The operators available on a field depend on the field type (Text, Date, Number). #### Date Field Operators Conditions using Date field operators will filter contacts based on the contact field compared with the datetime value provided in the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>is</td> <td>Matches contacts that have the datetime value for the field</td> </tr> <tr> <td>is not</td> <td>Matches contacts that do not have the datetime value for the field</td> </tr> <tr> <td>is blank</td> <td>No value is set for the field</td> </tr> <tr> <td>is not blank</td> <td>Any value is set for the field</td> </tr> <tr> <td>is after</td> <td>Matches the datetime value that occurs after the provided value for the field</td> </tr> <tr> <td>is at or after</td> <td>Matches the datetime value that matches or is after the provided value for the field</td> </tr> <tr> <td>is before</td> <td>Matches the datetime value that occurs before the provided value for the field</td> </tr> <tr> <td>is at or before</td> <td>Matches the datetime value that matches or is before the provided value for the field</td> </tr> <tr> <td>between</td> <td>Matches the datetime value that occurs on or after the start date and on or before the end date for the provided value for the field</td> </tr> <tr> <td>not between</td> <td>Matches the datetime value that occurs before the start date and after the end date for the provided value of that field</td> </tr> <tr> <td>is within</td> <td>Matches the datetime value that occurs between the date and time in the past based on the duration and the current datetime</td> </tr> <tr> <td>is not within</td> <td>Matches the datetime value that occurs before the date and time in the past based on the duration and the current datetime</td> </tr> <tr> <td>on</td> <td>Matches the datetime value that occurs at any time on the date provided</td> </tr> <tr> <td>not on</td> <td>Matches the datetime value that does not fall at any time on the date provided</td> </tr> </table> #### Number Field Operators Conditions using Number Field operators will filter contacts based on the contact field compared with the numeric value provided in the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>is</td> <td>Matches contacts that have the numeric value for the field</td> </tr> <tr> <td>is not</td> <td>Matches contacts that do not have the numeric value for the field</td> </tr> <tr> <td>is blank</td> <td>No value is set for the field</td> </tr> <tr> <td>is not blank</td> <td>Any value is set for the field</td> </tr> <tr> <td>is greater than</td> <td>Matches any numeric value that is greater than the provided value for the field</td> </tr> <tr> <td>is less than</td> <td>Matches any numeric value that is less than the provided value for the field</td> </tr> <tr> <td>is equal or greater than</td> <td>Matches any numeric value that matches or is greater than the provided value for the field</td> </tr> <tr> <td>is equal or less than</td> <td>Matches any numeric value that matches or is less than the provided value for the field</td> </tr> <tr> <td>is between</td> <td>Matches any numeric value that matches or is greater than the minimum value and matches or is less than the maximum value for the field</td> </tr> <tr> <td>is not between</td> <td>Matches any numeric value that is less than the minimum value and is greater than the maximum value for the field</td> </tr> </table> #### Text Field Operators Conditions using Text Field operators will filter contacts based on the contact field compared with the string value provided in the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>is</td> <td>Matches contacts that have the provided value for the field</td> </tr> <tr> <td>is not</td> <td>Matches contacts that do not have the provided value for the field</td> </tr> <tr> <td>is blank</td> <td>No value is set for the field</td> </tr> <tr> <td>is not blank</td> <td>Any value is set for the field</td> </tr> <tr> <td>contains</td> <td>Matches any value that may include other text as part of the value</td> </tr> <tr> <td>does not contain</td> <td>Matches any value that does not include the provided value</td> </tr> <tr> <td>starts with</td> <td>Matches any value that begins with the provided value</td> </tr> <tr> <td>does not start with</td> <td>Matches any value that does not begin with the provided value</td> </tr> <tr> <td>ends with</td> <td>Matches any value that ends with the provided value</td> </tr> <tr> <td>does not end with</td> <td>Matches any value that does not end with the provided value</td> </tr> </table> ### Operators available for Email Activity Fields Operators available on an Email Activity field are similar to Date fields with some exceptions—"is blank" and "is not blank" are not included on Email Activity fields. Email Activity conditions will filter contacts who have engaged with a Single Send or Automation based on the constraints of the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>is</td> <td>Matches contacts that have the datetime value for the field</td> </tr> <tr> <td>is not</td> <td>Matches contacts that do not have the datetime value for the field</td> </tr> <tr> <td>is after</td> <td>Matches the datetime value that occurs after the provided value for the field</td> </tr> <tr> <td>is at or after</td> <td>Matches the datetime value that matches or is after the provided value for the field</td> </tr> <tr> <td>is before</td> <td>Matches the datetime value that occurs before the provided value for the field</td> </tr> <tr> <td>is at or before</td> <td>Matches the datetime value that matches or is before the provided value for the field</td> </tr> <tr> <td>between</td> <td>Matches the datetime value that occurs on or after the start date and on or before the end date for the provided value for the field</td> </tr> <tr> <td>not between</td> <td>Matches the datetime value that occurs before the start date and after the end date for the provided value of that field</td> </tr> <tr> <td>is within</td> <td>Matches the datetime value that occurs between the date and time in the past based on the duration and the current datetime</td> </tr> <tr> <td>is not within</td> <td>Matches the datetime value that occurs before the date and time in the past based on the duration and the current datetime</td> </tr> <tr> <td>on</td> <td>Matches the datetime value that occurs at any time on the date provided</td> </tr> <tr> <td>not on</td> <td>Matches the datetime value that does not fall at any time on the date provided</td> </tr> </table> ### Operators available for Single Send Fields Single Send conditions will filter contacts who have engaged with a particular Single Send or any Single Send based on the constraints of the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>was sent</td> <td>Any contacts who were sent any Single Send or a specific Single Send in the specified time range</td> </tr> <tr> <td>has clicked</td> <td>Any contact who has clicked any Single Send or a specific Single Send in the specified time range</td> </tr> <tr> <td>has opened</td> <td>Any contact who has opened any Single Send or a specific Single Send in the specified time range</td> </tr> </table> ### Operators available for Automation Fields Automation conditions will filter contacts who have engaged with a particular Automation or any Automation based on the constraints of the condition. <table> <tr> <th>Operator Name</a></th> <th>Description</a></th> </tr> <tr> <td>was sent</td> <td>Any contacts who were sent any Automation or a specific Automation in the specified time range</td> </tr> <td>has opened</td> <td>Any contacts who has opened any Automation or a specific Automation in the specified time range</td> </tr> <tr> <td>has clicked</td> <td>Any contacts who has clicked any Automation or a specific Automation in the specified time range</td> </tr> </table> ## Adding Multiple Conditions with a Segment When using more than one condition to segment your contacts, you can select `AND` or `OR` as options, where `AND` requires both conditions to be true and `OR` requires either condition to be true. Once you’ve selected the field, operator, and value, you can layer additional conditions in the segment to narrow the results to a more targeted audience. <call-out type="warning"> At this time only one Email Activity, Single Send, or Automation condition may exist within a segment if combined using `AND`. Segments can combine more than one engagement activity condition using `OR.` </call-out> ## Duplicating a Segment Duplicating a segment eliminates the time and effort needed to recreate a complex segment from scratch in order to make a few changes or tweaks to reach a different audience. Follow these steps to create a copy of an existing segment. _To duplicate a segment:_ 1. From the Contact Lists page, click the Action Menu next to the name of the segment you wish to duplicate. 1. Select **Duplicate**. ## Exporting a Segment _To export a segment from the Contact List Page:_ 1. Click the Action Menu next to the name of the segment you wish to export. 1. Select **Export**. ![]({{root_url}}/img/duplicate-segment-contact-list-page.png 'Duplicate a segment from the contact list page') _To export a segment from the segment details page:_ 1. Click **Segment Options** to open the drop-down menu. 1. Select **Duplicate**. ![]({{root_url}}/img/duplicate-segment-details-page.png 'Duplicate a segment from the segment detail page') This triggers SendGrid to send an email to the primary email address on the account. The email includes a link to download the CSV of all the contacts in the list and their associated custom field values. <call-out> The download link for your CSV export will be valid for 24 hours. </call-out> ## Additional Resources - [Contacts]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#add-contacts) - [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) - [Tips on Segmenting Your Active Subscribers](https://sendgrid.com/blog/tips-on-segmenting-your-active-subscribers/) ================================================ FILE: content/docs/ui/sending-email/a-b-testing.md ================================================ --- layout: page weight: 50 title: A/B Testing Your Single Send group: marketing-campaigns navigation: show: true seo: title: A/B Testing Your Single Send override: true description: Optimize engagement of your campaigns with A/B testing, by sending different versions of your emails to a small subset of your contacts and measuring the engagement results. --- <call-out> A/B Testing is available for Single Sends only. It is not currently available for emails included as part of an Automation. </call-out> <iframe src="https://player.vimeo.com/video/385360745" width="640" height="400" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> Optimize the engagement of your Marketing Campaigns with A/B testing. A/B testing (sometimes also referred to by marketers as 'split testing') allows you to send different versions of your Single Sends to an initial subset of your contacts. ## Set up an A/B test _To set up an A/B test on an existing Single Send:_ 1. From the left-hand navigation, select **Marketing**, and then click **Single Sends**. 2. Locate the Single Send you want to A/B test and click on the Single Send to open it in the editor it was created in. 3. Depending on the editor used to create the Single Send, A/B testing is located on either the **Settings** tab or the **A/B Testing** tab. 4. Once you have located the A/B Testing settings, toggle the **Activate A/B Testing** switch to **ON**. ## Choose the Type of A/B Test To Run When you are A/B testing your emails, you want to optimize for a specific metric. Determine whether you want to optimize your **Open Rates** by testing the **Subject Line**, **Click Rates** by testing the **Email Content**, or if you want to manually select the winner of an A/B test based on your analysis of the data. <call-out> You can test up to 6 different variations for each A/B test. </call-out> - **Subject Line - Optimize Open Rates** Select the Subject Line A/B test to optimize the [Open Rate]({{root_url}}/glossary/open-rate/) of your Single Send, since the subject usually is all the recipient sees until they open your email. High open rates show the strength of a subject line. Once you find a subject line that works well, you will potentially see other engagement metrics improve as well. - **Email Content - Optimize Click Rates** Select the Email Content A/B test to optimize the Click Rate of your Single Send, since the recipient will not see this content unless they open your email. High click rates mean that you have compelling content and calls to action (CTAs). <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ## Adding Your Email Variations Enter the different variations of your email where you would normally edit that piece of content in your Single Send. - **Subject Line Testing** For subject line testing, you will find multiple input boxes in the sidebar where you would normally find your subject line, one for each subject line variation. - **Email Content Testing** For email content testing, you will see additional tabs at the top of the content area, one for each email content variation. The number of tabs you see will depend on how many versions you have decided to test. Make edits to each of your email content variations by selecting one of the tabs. If you'd like to create a new variation based on any of the existing variations, select the variation you wish to clone and then click **Manage Variations** and then **Duplicate Variation**. From there, you can make any modifications to the duplicate. If you already have 6 variations, you will need to delete one before duplicating. To delete a variation you no longer wish to keep, select the variation, click **Manage Variations** and then **Delete Variation.** When you do so, any remaining variations to the right of the deleted variation will be re-labeled and shift left. For example, if you have 3 variations and delete variation "B," variation "C" will become "B". <call-out> **A/B Testing Tip - Adding Variations** To know the direct cause for the best performing variation, we recommend only making one change per variation rather than many changes. This way, you can point to a direct cause for the differences in your stats. </call-out> ## Select the A/B Test Single Send Sample Size Choose a percentage of your contact list that will participate in the A/B test. Each variation of the email will be sent to the same number of contacts within the participating portion of your list. <call-out> The size of your sample can be up to 100% of your contact list. This may be helpful in the event that you would like to run two tests, send each test to a portion of your list, and manually select a winner. </call-out> ## Determine the Winning Criteria for the A/B Test Twilio SendGrid can automatically select the winner of a test based on either the open rate or click rate. You can also manually select a winner when neither of the automatic selections suits your needs. - **Unique Open Rate** Twilio SendGrid automatically selects the winning variation based on how many recipients [open]({{root_url}}/glossary/opens/) your email. - **Unique Click Rate** Twilio SendGrid automatically selects the winning version based on how many recipients [click]({{root_url}}/glossary/clicks/) links and engage with the content in your email. - **Manual** You can evaluate the performance of all variants and manually choose a winner based on each variant's performance across multiple metrics. ## Set the A/B Test Duration You can set your A/B test duration between 30 minutes and 24 hours. While you can test your email variations for up to 24 hours, emails will only be sent to the subset of contacts you've chosen to participate in the A/B test during the test duration you set. The remainder of your contacts will only be sent the winning variation of your A/B test email after the test duration has completed. <call-out> **A/B Testing Tip - Setting the Test Duration** You should be mindful of your test duration, with respect to the timeliness of your Single Send content. For example, if you have a one-day sale that happens the day of your Single Send, you should set the A/B test duration to less than 24 hours so that your remaining contacts still have time to get the final email and participate in your one-day sale. </call-out> ## Sending the winning A/B test variation ### Automatically selected winners When a variation wins based on unique click rate or unique open rate, you will be notified that a winner was chosen and which variation won. SendGrid will automatically send the winning email variation to the rest of your list. ![]({{root_url}}/images/ab_testing_4.png 'A/B test winner') ### Manually selecting a winner There are likely times when neither the open rate nor the click rate alone best measures the success of a message. If, for example, version A had an open rate of 48% while version B had an open rate of 49%, version B would win an automatic selection based on open rate. However, if those two versions also had click rates of 45% for version A and 10% for version B, your winner based on a narrow margin in open rate would be significantly underperforming the alternative version in click rate. This is one scenario in which you could select a manual winner or re-evaluate your criteria for success. You may also want to optimize for alternative metrics, including those that aren't tracked by Marketing Campaigns, such as conversions. Manually selecting a winner allows you to prioritize the metrics that are most important to you, including unsubscribes, spam reports, conversions, and more. At the end of the A/B test duration, you will receive an email asking you to select the winner of your test. _To manually select the winner_ 1. Navigate to the [**Marketing Campaigns** > **Single Sends**](https://mc.sendgrid.com/single-sends) page. 2. Select the Single Send associated with the completed A/B test. 3. You will see the performance of each test variant across the following metrics - **Delivered** - **Opens** - **Clicks** - **Unique Opens** - **Click Through Rate** - **Total Click Through Rate** - **Unsubscribes** - **Spam Reports** ![The stats or performance overview page for a Single Send A/B test]({{root_url}}/img/single_send_stats_overview_manualAB.png 'Single Send A/B test stats') 4. Click the radio button beside a test variant to select it as the winner. 5. Click **Pick Winner**. 6. You will be presented with a modal asking you to confirm your selection. Click **Confirm** to proceed or **Cancel** to close the modal without selecting a winner. 7. After clicking **Confirm**, the winner will be sent to the remaining contacts in your list. The winner will also be labeled on the Single Sends Dashboard and the Single Sends statistics overview page. #### Test expiration You must select the winner of a manual A/B test within 7 days of the test completing. You will receive an email one day before and one day after a test expires to keep you up to date about the test's status. The last date to select a test winner is also displayed on both the Single Sends index page and a Single Send's statistics summary page. ![The Single Sends overview page with expired and soon to expire dates highlighted]({{root_url}}/img/select_winnerAB_single_send_index.png 'Single Sends Overiew Page') ![A Single Send's stats overview page with the expiration date highlighted]({{root_url}}/img/select_winner_byAB_stats_page.png 'Single Send A/B test stats page') ## Additional Resources - [Campaign Statistics]({{root_url}}/ui/analytics-and-reporting/marketing-campaigns-stats/) - [Design Editor]({{root_url}}/ui/sending-email/editor/#the-design-editor) - [Code Editor]({{root_url}}/ui/sending-email/editor/#the-code-editor) ================================================ FILE: content/docs/ui/sending-email/adding-dynamic-content-with-handlebars-in-marketing-campaigns.md ================================================ --- layout: page weight: 100 title: Adding Dynamic Content with Handlebars in Marketing Campaigns group: marketing-campaigns seo: title: Adding Dynamic Content with Handlebars in Marketing Campaigns description: The use cases on this page will help you utilize Handlebars helpers to deliver dynamic content targeted to your customers. keywords: Handlebars, formatDate, equals, greaterThan, lessThan, conditionals, dynamic, template, design, content navigation: show: true --- Marketing Campaigns allows you to [insert substitution tags]({{root_url}}/ui/sending-email/editor/#using-substitution-tags) into your email content or subject lines. The tags you insert will dynamically populate the custom field data for that field on a per-recipient basis. You can go beyond simple custom field replacement, using dynamic content and Handlebars to meet your goals. To understand how to add tags to your Marketing Campaigns designs, see our [Editor documentation]({{root_url}}/ui/sending-email/editor/). The Editor documentation also explains how to preview your message with sample data. This page provides several example use cases to show you how to modify the dynamic content in your designs with Handlebars. For a full reference of all available helpers, see [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/). First, we’ll outline how to handle default values when using handlebars in Marketing Campaigns. ## Understand default values and Handlebars When you copy a tag from the **Tags** tab in the Marketing Campaigns editors, pasting the tag into your design will add a “default” automatically. The tag will look like the following example — the tag name followed by a pipe character and the word "default." You can think of the pipe as the word "or." This means the tag will be your recipient's `first_name` _or_ the word "default." ```handlebars {{ first_name | default }} ``` The default is meant to provide a fallback value for the tag in the event that it cannot be populated with real data. For example, if you replace the word “default” with “Valued Customer,” your message will be delivered with the recipient's `first_name` _or_ the phrase “Valued Customer” when data for `first_name` is not available. This is usually preferable to a failing tag, which will display no text. ```handlebars {{first_name | Valued Customer}} ``` ### Syntax changes for saved tags Default values are compatible only with the `insert` keyword. When you save your design, the tag’s syntax will change to become compatible with the `insert` keyword automatically. If you see the syntax change, don’t be concerned. **The tag when pasted** ```handlebars {{first_name | Valued Customer}} ``` **The tag when saved** ```handlebars {{insert first_name 'default=Valued Customer'}} ``` ### Defaults without the insert keyword The `insert` keyword and default values cannot be added to a tag when using another Handlebars helper to achieve more complex functionality. For example, you cannot [format a date](#use-the-formatdate-helper) with the formatDate helper and provide a fallback or default value for that formatted date in a single tag. The following example will break. **Broken example** ```handlebars {{insert formatDate due_date "MM/DD/YYYY" 'default=30 days after signup'}} ``` Because tags copied from the **Tags** tab are pasted with a default placeholder automatically, you must delete the `| default` portion of the tag when using other Handlebars helpers. If your helper is not working as expected, be sure that the tag did not save with `insert` and `'default=default'` inside. To achieve fallback behavior when using other helpers, you can use conditional statements. For example, to a create a fallback for formatDate, you could wrap the tag in `{{#if}} {{else}}` tags as shown in the following example. **Working example** ```handlebars {{#if due_date}} {{formatDate due_date "MM/DD/YYYY"}} {{else}} 30 days after signup {{/if}} ``` For more on conditional statements, see our [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) page. ## Use the formatDate helper Twilio SendGrid stores dates in [ISO 8601 date format](https://www.iso.org/iso-8601-date-and-time-format.html). This standard date format helps ensure that we handle dates and times correctly. However, ISO 8601 date format isn’t what recipients usually expect in the text of an email. For this reason, we provide the formatDate Handlebars helper to convert dates from ISO 8601 to a friendlier date format such as MM/DD/YYYY. In Marketing Campaigns, you can use this helper to change how a date tag displays within your subject line or email content. For context, the tag options you see within the Marketing Campaigns editor are automatically created based on your custom fields. The following example assumes you have a custom date tag called `offer_expiration`. You want to use this date tag to display the end of a promotion, prompting customers to take action before they miss out. Within the Marketing Campaigns editor, your email copy looks like this (after removing the default value for your date field): ```handlebars Happy Cake or Pie Anniversary {{ first_name | to you }}! It’s hard to believe, but you joined the Cake or Pie Delicious Delivery service a year ago. We appreciate loyal customers like you, which is why we’re sending you a little anniversary gift offer. You’ll receive 15% off all orders placed during your anniversary month. That’s 15% off all orders placed before {{ offer_expiration }}! Thanks for being a customer, The Cake or Pie Team ``` As is, this email copy would display the `offer_expiration` in the ISO 8601 format (for example, `2020-05-08T17:06:24Z`). To change how this displays, you’ll use the formatDate helper. Inside the Handlebars, `{{ }}`, add the name of the helper, formatDate, before the name of your tag. This tells Twilio SendGrid that you want to format the date for the `offer_expiration` tag. Keep a space before and after formatDate. ```handlebars {{ formatDate offer_expiration }} ``` You must then place the format you want to display in your email following the name of the tag. The formatting should be placed in quotation marks. Keep a space before and after your quotation marks. ```handlebars {{ formatDate offer_expiration "MM/DD/YYYY" }} ``` To change the displayed format for any date tag, you will always follow this pattern: ```handlebars {{ formatDate <date tag> "<desired format>" }}. ``` <call-out> To see which format tokens (eg. YYYY, dddd, MM) are available to display different date formats, see the full reference for the [formatDate helper]({{root_url}}/for-developers/sending-email/using-handlebars/#formatdate) in our Handlebars documentation. </call-out> ## Conditional checks based on customer attributes Handlebars makes it possible to change the content of a message based on customer attributes that may not lend themselves to a segment. For example, you may want to deliver different messages based on customers’ ZIP codes or spoken languages. ### Conditional check with equals In this example, you will see how to conditionally change a message based on a recipient’s proximity to a store location, allowing you to deliver the sales most relevant to them. To achieve this, you can maintain a custom field called `nearest_zip_code` that holds the store nearest each customer. You will automatically have this custom field available to you on the Tag tab in the Marketing Campaigns editors. To change your message using this tag, your Handlebars code might look like the following example. ```handlebars {{#equals nearest_zip_code 1234}} 20% off all paperback books! {{else}} Amazing savings! {{/equals}} ``` This example uses the `equals` helper to check the value of `nearest_zip_code` for each recipient. If the recipient’s nearest ZIP code equals 1234, they will see “20% off all paperback books.” If they are anywhere _else_, they will see “Amazing savings!” This type of conditional may be helpful, but you will likely want to check for more than a single ZIP code. In this case, it’s also possible to add multiple equals checks chained onto else checks. At the end of your Handlebars block, be sure to add the closing equals tag, `{{/equals}}`, for each opening equals tag, `{{#equals}}`. To check for three ZIP codes, your Handlebars might look like the following example. ```handlebars {{#equals nearest_zip_code 12345}} 20% off all paperback books! {{else}}{{#equals nearest_zip_code 23456}} 10% off all historical fiction {{else}}{{#equals nearest_zip_code 34567}} Amazing savings! {{/equals}}{{/equals}}{{/equals}} ``` Notice the three closing `{{/equals}}` tags, one for each `{{#equals}}` check. <call-out type="warning"> Be sure to test more complex uses of Handlebars before sending a message to one of your lists. Not all complex Handlebars can be previewed accurately using the **Preview** tab in Marketing Campaigns at this time. </call-out> You could use a similar approach to check for the preferred language of your customers and provide text in that language. Using equals would make it possible to store a single `language` custom field and check its value as shown in the following example. ```handlebars {{#equals language "english"}} Hello, World! {{else}}{{#equals language "español"}} ¡Hola Mundo! {{else}}{{#equals language "français"}} Bonjour le monde! {{/equals}}{{/equals}}{{/equals}} ``` ### Conditional check with greaterThan You can use the greatThan helper to display text based on checks against number fields. For example, you might store the number of purchases a customer makes in a custom field called `total_purchases`. You might have another field where you store the current purchase goal for your customers called `purchase_goal`. If you wanted to deliver a message to either reward those who had exceeded your `purchase_goal` or encourage engagement from those who hadn’t, your Handlebars might look like the following example. ```handlebars {{#greaterThan total_purchases purchase_goal}} Thank you for being a loyal customer. To show our appreciation, please enjoy an additional 15% off your next purchase. {{else}} We appreciate new customers like you. That’s why we’re offering 10% off your next purchase. {{/greaterThan}} ``` For recipients whose `total_purchases` are greater than your `purchase_goal`, the message will display, “Thank you for being a loyal customer. To show our appreciation, please enjoy an additional 15% off your next purchase.” For those whose `total_purchases` is equal to or less than your `purchase_goal`, the message will display, “We appreciate new customers like you. That’s why we’re offering 10% off your next purchase.” You could use a similar strategy with the lessThan helper. ## Additional resources - [Design and Code Editor]({{root_url}}/ui/sending-email/editor/) - [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) - [Cross-Platform Email Design]({{root_url}}/ui/sending-email/cross-platform-html-design/) ================================================ FILE: content/docs/ui/sending-email/attachments-with-digioh.md ================================================ --- seo: title: Sending Attachments with Digioh title: Sending Attachments with Digioh group: partners weight: 0 layout: page navigation: show: true --- ## Limitations ### v3 Mail Send The total message size of emails sent via the [v3 mail send endpoint](https://sendgrid.api-docs.io/v3.0/mail-send) is limited to 30MB. This includes all headers, the body, and attachments. That means that the maximum attachment size depends on the size of the rest of the stuff in your message, but we do recommend that your attachments do not exceed 10MB. ### v2 Mail Send The total message size of emails sent via the [v2 mail send endpoint](https://www.twilio.com/docs/sendgrid/api/v2/mail) is limited to 20,480,000 bytes, or approximately 19.5MB. This includes all headers, the body, and attachments. We recommend that your attachments do not exceed 7MB. <call-out> Keep in mind that the size of your file on disk or in memory may not be the same as the size of the file once it is attached, as files must be encoded as text to be sent. You can expect an increase in size of up to 30%. </call-out> ## Best Practices Attachments are in and of themselves potential risks when sending email. Email filters are more likely to prevent delivery of a message that has an attachment due to the risk of viruses. A good alternative to attaching a file to your message is to place it on a page of your website, and then provide a link to that web page within your message body. ## Using Digioh SendGrid has partnered with Digioh, a digital download distribution service. This allows you to send files up to 2GB in your SendGrid Marketing Emails. Digioh also allows you to track individual downloads and prevent non-subscribers from downloading files. Digioh is integrated with SendGrid's Marketing Email solution, so you can be up and running in no time. [Sign Up for a Free Digioh + SendGrid Account](https://digioh.com/sendgrid) ## Sending email with attachments via SendGrid To send emails with attachments via SendGrid, you can employ our [SMTP Relay]({{root_url}}/glossary/smtp-relay) or our [Web API v3](https://sendgrid.api-docs.io/v3.0/mail-send). ================================================ FILE: content/docs/ui/sending-email/blocks.md ================================================ --- layout: page weight: 0 title: Blocks group: delivery-optimization seo: title: Blocks description: When your email has been blocked by an ISP or your IP is on a deny list. keywords: blocks, bounces, hard bounces, deny list, ISP Blocks, Mail provider blocks navigation: show: true --- [Blocks]({{root_url}}/glossary/blocks/) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a deny list, blocked by an ISP, or if the message content is flagged by a filter on the receiving server. The “Reason on the Block” will clarify what the exact reason is. Typically, it’s possible to have your IP address removed from a deny list, and some lists automatically do this after a period of time. Message content can be modified to correct a filtered block. <call-out> Unlike addresses on our other suppression lists, new messages to blocked addresses will be attempted, as the message content is likely different, and may not be blocked. </call-out> The list provided here can be filtered by email address or date. ## Searching Blocks by Date In the top right corner, you will see a calendar icon. Click this and choose the dates you would like to search between. Your recipient list will refresh, showing the email addresses that were blocked between these dates as well as the block reason. ## Removing Recipients from The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. ## Download Blocks as CSV You can download your Global Unsubscribe list as a CSV by clicking the gear icon at the top of the page and selecting “Download CSV.” The file will download in your browser right away. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> ## Additional Resources - [Bounces]({{root_url}}/ui/sending-email/bounces/) - [Global Unsubscribes]({{root_url}}/ui/sending-email/global-unsubscribes/) - [Web API and Blocks](https://sendgrid.api-docs.io/v3.0/blocks-api) <call-out> Looking for customized expert advice to improve your email program? Our team of email experts can help you create a plan to ensure you're optimizing your email delivery and engagement, and avoiding future issues. Learn more on our [Expert Services](https://sendgrid.com/solutions/expert-services/?utm_source=docs) page. </call-out> ================================================ FILE: content/docs/ui/sending-email/bounces.md ================================================ --- layout: page weight: 0 title: Bounces group: delivery-optimization seo: title: Bounces description: SendGrid will help prevent you from resending to a recipient whose email server rejects the messages. keywords: Bounce suppressions, bounce unsubscribes, bounce email unsubscribe, bounce email suppression navigation: show: true --- A bounce occurs when a sent message is rejected by the receiving mail server. The most common causes for bounced email messages include a misspelled or nonexistent email address. A repeat bounce is when an address has bounced, then bounced a second time and logged to the bounce suppression list, but you ask us to send to this recipient again. Our system will suppress the message because it ‘knows’ that recipient address is bad. ## Bounce Notifications If you would like to receive a notification for each bounce message, you can turn on Bounce Forwarding in your Mail Settings. ## Searching Bounces by Date In the top right corner, you will see a calendar icon. Click this and choose the dates you would like to search between. Your recipient list will refresh, showing the recipients who bounced between these dates. ## Download Bounces as CSV You can download your Bounce list as a CSV by clicking the gear icon at the top of the page and selecting **Download CSV**. The file will download in your browser right away. ## Removing Recipients From The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. You can also use the Bounce Purge. ## Additional Resources - [Global Unsubscribes]({{root_url}}/ui/sending-email/global-unsubscribes/) - [Group Unsubscribes]({{root_url}}/ui/sending-email/group-unsubscribes/) <call-out>  Looking for customized expert advice to improve your email program? Our team of email experts can help you create a plan to ensure you're optimizing your email delivery and engagement, and avoiding future issues. Learn more on our [Expert Services](https://sendgrid.com/solutions/expert-services/?utm_source=docs) page.  </call-out> ================================================ FILE: content/docs/ui/sending-email/checking-email-source.md ================================================ --- seo: title: How do I check the headers/raw source of an email? description: How do I check the headers/raw source of an email? keywords: bounces, email, headers, raw, source title: How do I check the headers/raw source of an email? group: delivery-optimization weight: 0 layout: page navigation: show: true --- Being able to check the raw headers of an email can be incredibly useful when troubleshooting. Headers contain all sorts of details about a message's security, composition, and even the journey it takes from point A to point B. Our Support agents may sometimes ask you to give us the raw source or headers of an email to help them solve email issues. Below are a few methods for obtaining headers in some popular mail clients. **Gmail** ![]({{root_url}}/images/headersgif2.gif) **Thunderbird** ![]({{root_url}}/images/TbirdheadersGIF.gif) **Outlook** ![]({{root_url}}/images/Outlookheaders.gif) **Yahoo** Look for the option called "View Raw Message" under the More menu (displayed as 3 dots). ================================================ FILE: content/docs/ui/sending-email/coming-soon-to-new-marketing-campaigns.md ================================================ --- title: Coming soon to Marketing Campaigns weight: 0 group: marketing-campaigns layout: page navigation: show: false seo: title: Coming soon to Marketing Campaigns description: Coming soon to Marketing Campaigns keywords: sendgrid account, sendgrid plan, email account, emails per month --- **Pardon our dust!** There are some important features that are coming soon to our brand new version of Marketing Campaigns, we appreciate your patience as we deliver them for you. <table> <tr> <th><span style="font-weight:bold">Deliverable</span></th> <th><span style="font-weight:bold">Targeted availability</span></th> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/sending-email/email-testing/#purchasing-additional-credits" target="_blank" rel="noopener noreferrer">Additional Email Testing credits</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/sending-email/a-b-testing/" target="_blank" rel="noopener noreferrer">A/B testing for Single Sends</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/managing-contacts/segmenting-your-contacts" target="_blank" rel="noopener noreferrer">Create segments based on custom fields, reserved fields, and engagement with Single Sends</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td>Segmentation API</td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/sending-email/working-with-marketing-templates/#creating-a-template-from-a-single-send" target="_blank" rel="noopener noreferrer">Saving a Single Send or Automation email as a template</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/sending-email/working-with-marketing-templates/#duplicating-a-custom-template" target="_blank" rel="noopener noreferrer">Duplicating a Marketing Campaigns template</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td>View a sample of contacts on a segment</td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td>Send a test email from within Single Sends</td> <td><span class="status-highlighter">Delivered</span></td> <tr> <td>View a sample of contacts on a list</td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td>Designate an IP pool for a Single Send</td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/sending-email/getting-started-with-automation/#automation-use-cases-and-examples" target="_blank" rel="noopener noreferrer">Trigger an automation to a segment</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td><a href="https://sendgrid.com/docs/ui/analytics-and-reporting/marketing-campaigns-stats/" target="_blank" rel="noopener noreferrer">View which links within an email were clicked</a></td> <td><span class="status-highlighter">Delivered</span></td> </tr> <tr> <td>View per-contact engagement data</td> <td>Future</td> </tr> <tr> <td>Export statistics for a Single Send or an Automation</td> <td>Q3 2020</td> </tr> <tr> <td>Automation API</td> <td>Future</td> </tr> </table> ================================================ FILE: content/docs/ui/sending-email/content-delivery-networks.md ================================================ --- seo: title: Content Delivery Networks title: Content Delivery Networks group: delivery-optimization layout: page weight: 0 navigation: show: true --- Content Delivery Networks are a great mechanism that you can use to serve up content very quickly and easily across multiple mediums as well as handle security certificates for you. We suggest [CloudFlare](#using-cloudflare), [Fastly](#using-fastly), or [KeyCDN](#using-keycdn) when using Content Delivery Networks with SendGrid. ## Using CloudFlare The following instructions assume you already have a CloudFlare account made, using either a [Full DNS setup](https://support.cloudflare.com/hc/en-us/articles/205195708) or a [CNAME setup](https://support.cloudflare.com/hc/en-us/articles/200168706). You can compare the 2 different setups [here](https://support.cloudflare.com/hc/en-us/articles/203685674). Note that a CNAME setup is only available to Business or Enterprise level CloudFlare plans. The instructions also assume that you have set up a valid [branded link]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) on your account. This step is essential for the following instructions to work. Begin by logging into your CloudFlare account, and navigating to the DNS settings for your domain. ![CloudFlare DNS Settings]({{root_url}}/images/cloudflare1.png) Add a new CNAME entry that points your configured branded link domain to sendgrid.net. ![CloudFlare DNS Addition]({{root_url}}/images/cloudflare2.png) Once the record is created, click on the cloud icon under the Status column to turn it orange and enable HTTP proxy. ![CloudFlare DNS HTTP proxy]({{root_url}}/images/cloudflare3.png) Next, navigate to the Page Rules settings for your domain. You will need to create a Page Rule for your branded link domain that sets SSL to Full. This is necessary due to how [CloudFlare validates the certificate on the origin](https://support.cloudflare.com/hc/en-us/articles/200721975). You can find more information on the different SSL options [here](https://support.cloudflare.com/hc/en-us/articles/200170416). ![CloudFlare Page Rules Addition]({{root_url}}/images/cloudflare4.png) Ensure that the Page Rule is On. ![CloudFlare Page Rules Verification]({{root_url}}/images/cloudflare5.png) If you are using a CNAME setup, you will also need to change DNS to point to the CloudFlare CNAME you created. Once all of this is done, you will need to contact [SendGrid support](https://support.sendgrid.com/) and request that SSL click and open tracking be enabled on your account. They will then verify the configuration and enable the setting on your account. ## Using Fastly 1. [Sign up for Fastly](https://www.fastly.com/signup/) or [log in](https://manage.fastly.com) to an existing account. 2. Click **Configure** on the Dashboard. 3. Click the gear icon to open the **Manage Service** menu and click **Create**. Set the options as follows: * **Server address and port:** `sendgrid.net` : `443` _The connection on the SSL port 443_ * **Domain:** `email.example.com` _Enter your branded link domain here. Ensure it matches the domain configured in the SendGrid link branding settings. This value will be what recipients see in your SSL enabled click tracking links._ * **Description:** `SendGrid` (or whatever you like) Finally, click the **Create**. The new service will appear in the list of available services. Contact SendGrid support to validate your CDN settings and enable SSL click and open tracking. <call-out> For more information, please visit [Fastly's documentation](https://docs.fastly.com/guides/basic-setup/working-with-services#creating-a-new-service). </call-out> ## Using KeyCDN This section is maintained by KeyCDN, if you have any questions about KeyCDN please [contact their support](https://www.keycdn.com/support/) team. [Sign up for KeyCDN](https://app.keycdn.com/signup) or login to your existing account. Create a pull zone and point the origin URL to https://sendgrid.net. ![KeyCDN Pull Zone]({{root_url}}/images/keycdn1.png) Enable SSL and HTTP/2 (custom SSL or Let's Encrypt). ![KeyCDN Enable SSL]({{root_url}}/images/keycdn2.png) Enable the option "Forward Host Header." ![KeyCDN Forward Host Header]({{root_url}}/images/keycdn3.png) Create a CNAME record in your DNS settings pointing the alias you want to use for your email branded link domain (e.g. email.domain.com) to the Zone URL provided within your KeyCDN dashboard (e.g. sendgrid-1c6b.kxcdn.com). Then, add that alias as a Zonealias. ![KeyCDN Zonealias]({{root_url}}/images/keycdn4.png) Finally, [contact SendGrid support](https://support.sendgrid.com/hc/en-us), and they'll validate the CDN settings and enable SSL click and open tracking. ================================================ FILE: content/docs/ui/sending-email/create-and-edit-legacy-transactional-templates.md ================================================ --- title: Create and Edit Legacy Transactional Templates group: transactional-email seo: title: Create and Edit Legacy Transactional Templates description: Transactional email templates are pre-coded email layouts that anyone can use to easily create and send transactional emails. keywords: transactional email templates, email template, create templates weight: 80 layout: page navigation: show: true --- Creating email templates involves a mix of content writing, HTML, and CSS expertise. Email templates should look good on different email clients and be responsive for mobile devices. Many non-technical customers will hire a front-end or email template developer to build their templates. We also suggest testing your templates with rendering applications like [Litmus](http://litmus.com) before sending them to your customers. <call-out> The maximum number of transactional templates and versions per user ID is limited to 300. This means you can have 300 templates with 1 version each, or fewer templates with more versions of each template. </call-out> <call-out> Transactional templates are account and Subuser specific. Templates created on a parent account will not be accessible from the Subuser accounts. </call-out> ## Creating a template 1. Open the [Legacy Templates](https://sendgrid.com/templates) page and then click **Create Template**. 1. Add a unique template name in the dialogue box and then click **Save**. 1. Open the **Actions** drop-down menu to create a new version. 1. Click **Add Version**. <br></br>The editor opens. From here, you can change the subject and the body of your email template. The easiest way to get started with a new template is to use one of your previous email templates or a free template from the internet, and then modify it to fit your needs. ## Editing your HTML template <call-out> Email templates are table-based HTML with inline or header styles, because some well-known email applications will only read table-based HTML. </call-out> *To add a template:* 1. Open a new template in the [Code Editor]({{root_url}}/ui/sending-email/editor/#the-code-editor) or [Design Editor]({{root_url}}/ui/sending-email/editor/#the-design-editor) by clicking **Actions** and selecting **New Version**. 1. If you selected the Code Editor, copy and paste your HTML code into the code editor. <br></br>If you paste in an email template, it is likely that you will overwrite the default basic HTML provided in the code editor. If you selected the Design Editor, use the WYSIWYG editor with drag & drop modules to create your email template. 1. When you’re done editing, click **Save**. <br></br>Please double check that the content is formatted correctly before you send an email using this template. ## Preview and test your template SendGrid suggests previewing and testing your template once you have created it to ensure that the format and layout look the way you expect. *To preview your template:* 1. Select **Preview**. <br></br>A window pops out with a preview of the email that you’re going to test, with the option to view the template formatted for both mobile and desktop platforms. 1. Click **Send Test** to send a test email using your new template. 1. Fill in the *recipient* and *subject line* fields and then click **Send**. <call-out> Any Substitution tags will not be populated in this test, but you will be able to confirm the layout and format of your template. </call-out> ## Managing templates From the main template view on each template group, you will see an actions menu. From this menu, you can choose to edit the name of your template, add a version, preview, test, or delete the template. You will also see an action menu for each template version. Clicking this presents a menu that allows you to preview and test, edit, duplicate, and delete the template version. You can also use the preview function to send a test. <call-out> When you delete a template you will delete all the versions of your template. </call-out> ### Activate your template *To activate your template:* 1. Navigate to the template you wish to use and select the action menu. 1. Select **Make Active**. <call-out> A template can only have one active version at a time. If you’ve created a new version with different HTML that you want your customers to start receiving, you’ll need to make that version “Active.” </call-out> ### Duplicate a Template *To duplicate a template:* 1. Navigate to the template you wish to use and select the action menu. 1. Select **Add Version**. The app creates a clone, giving it a name that starts with "untitled". You can give the template a unique name by selecting the action menu next to that version and clicking **Edit**. Once the editor has opened, enter a unique name in the *Template Name* field. This duplicate version will not be active until you activate it. ## Adding unsubscribe links to a template For more information about unsubscribes, check out our [unsubscribe documentation]({{root_url}}/ui/sending-email/index-suppressions/). ## Additional Resources - [Dynamic Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) - [Design & Code Editor]({{root_url}}/ui/sending-email/editor/) ================================================ FILE: content/docs/ui/sending-email/create-and-manage-unsubscribe-groups.md ================================================ --- layout: page weight: 90 group: marketing-campaigns title: Create and Manage Unsubscribe Groups seo: title: Create and Manage Unsubscribe Groups description: Suppression Manager helps you to define and manage unsubscribe groups to keep you out of the spam folder. keywords: unsubscribe groups, suppressions, manage unsubscribe groups, delete unsubscribe groups navigation: show: true --- <iframe src="https://player.vimeo.com/video/373265768" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> <call-out> This page is describing the functionality of the new Marketing Campaigns experience. If you're using legacy Marketing Campaigns, your workflow and screens may be a little different. For more information on the new Marketing Campaigns experience click [here](https://sendgrid.com/pricing). </call-out> Adding Unsubscribe Groups to your emails makes it easy to honor your recipients' email preferences and protect your sender reputation by complying with anti-spam legislation. ## Create an Unsubscribe Group *To create an Unsubscribe Group:* 1. Select **Marketing** and then click **Unsubscribe Groups**. 1. Click **Create New Group**. 1. Add a *Group Name* and *Group Description*. <call-out> Make sure your Group Names and Group Descriptions are customer-friendly. This is what your recipients will see. </call-out> 4. Select the checkbox if you want the Unsubscribe Group to display on the unsubscribe preferences page. 5. Click **Save Unsubscribe Group**. <call-out> To view the unsubscribe preferences page, select the action menu next to an Unsubscribe Group and then click **Preview**. Toggle to the Unsubscribe Preferences tab to view all of the options listed. </call-out> ## Adding an Unsubscribe Group to your Email *Using the Design Editor:* 1. Select your preferred Unsubscribe Group by clicking **Settings** and selecting the group from **Recipients**. 1. From the **Build** tab, drag the **Unsubscribe** module to insert Sender Information and a link to the `{{{unsubscribe}}}` tag. 1. To manually hyperlink to the {{{unsubscribe}}} tag, enter the text you would like to link. 1. Highlight the text then select the link icon from the top toolbar. 1. In the URL field enter `{{{unsubscribe}}}`, then click **Save**. *Using the Code Editor:* 1. Select your preferred Unsubscribe Group by navigating to **Settings** and then selecting **Recipients**. 1. Enter the following code styling to the HTML window where you would like your unsubscribe content placed: ``` <a href="{{{unsubscribe}}}">Click here to unsubscribe.</a> ``` ## Using a Custom Unsubscribe Link While Twilio SendGrid Unsubscribe Groups are a powerful way to manage unsubscribes and email preferences, we realize some senders may have their own subscription management tools. For these senders, Marketing Campaigns supports custom unsubscribe links as well. If you would like to use a custom URL for your unsubscribe link, from the Editor, navigate to **Settings** in the left-hand sidebar and select the **Recipients** dropdown menu. Under **Unsubscribe Group**, select **Use Custom Link...** This will expand a new field where you can insert a URL for one of your own pages where recipients can manage their subscription preferences. To place your Custom Unsubscribe link into your email, highlight any text within the body of your email and click the small link icon to specify a hyperlink. In the URL field that appears, enter the tag `{{{unsubscribe}}}`. Since you've specified your Custom Unsubscribe Link in the Settings panel, SendGrid will replace the Unsubscribe Tag with your custom URL. ## Add recipients to an Unsubscribe Group You can add recipients to an unsubscribe group by uploading a CSV or adding them manually using the UI. To programmatically add recipients to an unsubscribe group, see our [API documentation](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups) *To upload a CSV:* 1. Find the group you want to add recipients to and click the action menu. ![]({{root_url}}/img/unsub_action_menu.png "Unsubcribe Group action menu") 2. Select **Upload a CSV**. 3. Drag the CSV you want to upload into the field, or click **select a CSV file to upload** and locate the file you want to upload from your files. 4. Click **Upload CSV**. *To manually add recipients to an Unsubscribe Group:* 1. Find the group you want to add recipients to and click the action menu. 1. Select **Manually Add**. 1. Enter a recipient email address and then click **Save**. ## Managing Unsubscribe Groups From the UI, you can edit Unsubscribe Groups or download a list of recipients that have unsubscribed from your emails. For more information on managing unsubscribes, see the SendGrid [Suppressions Overview]({{root_url}}/ui/sending-email/index-suppressions/#managing-unsubscribes) ### Exporting an Unsubscribe Group List *To export an Unsubscribe Group List:* 1. Navigate to the Unsubscribe Group you want to export. 1. Click the action menu. 1. Select **Export**. Once the export is completed, a download link will be sent to the email(s) you either signed up with, or have set to receive [notifications]({{root_url}}/ui/account-and-settings/notifications/). ### Editing an Unsubscribe Group *To edit an Unsubscribe Group:* 1. Navigate to the Unsubscribe Group you want to edit. 1. Click the action menu. 1. Select **Edit**. From the Edit Group page, you can change the Group Name, Group Description, and display preferences. ### Deleting an Unsubscribe Group *To delete an Unsubscribe Group:* 1. Navigate to the Unsubscribe Group you want to delete. 1. Click the action menu. 1. Select **Edit**. The Edit Group page opens. 1. Click **Delete Group**. 1. Confirm that you want to delete the selected group and then click **Delete**. ![]({{root_url}}/img/confirm_unsub_group_delete.png "Confirm Unsubscribe Group Delete") ## Additional Resources - [Suppressions Overview]({{root_url}}/ui/sending-email/index-suppressions/) - [Group Unsubscribes]({{root_url}}/ui/sending-email/group-unsubscribes/) - [Global Unsubscribes]({{root_url}}/ui/sending-email/global-unsubscribes/) ================================================ FILE: content/docs/ui/sending-email/cross-platform-html-design.md ================================================ --- seo: title: HTML Rendering - Cross-Platform Email Design description: HTML Rendering - The Do's and Dont's of Cross-Platform Email Design keywords: render, message, layout, html, css, cross-platform title: Cross-Platform Email Design group: building-email weight: 0 layout: page zendesk_id: 200184928 navigation: show: true --- All Mail clients render HTML/CSS differently, in their own ways and for their own reasons. The differences in what HTML and CSS they support depends on many factors. When rendering HTML and CSS in emails many things impact what the end user is going to see. The mail exchange server, the preprocessor, the browsers, the rendering engines, and more; all affect the way your message is going to be displayed. These vary from client to client; browser to browser; server to server. However, don't start pulling your hair out just yet, because there are some best practices you can utilize so that your emails' coding will stay intact across different clients and platforms. ## Layout - **Avoid using padding or margins** - Certain email clients don't support these formatting settings. For example, Outlook cannot support padding, and Hotmail cannot support margins. - These can be especially problematic when added inside of a table in either mail client. - **Always use inline CSS** - Most webmail clients (Outlook.com, Yahoo.com, Gmail, etc) will strip CSS out when stripping the head and body tags. - Make sure you render coding very carefully so it conforms to the email client's pre-set HTML. - **Avoid BR, HR, and height tags in your emails** - Every browser/client has their own default line height and will default to it most of the time. - Workaround in next bullet point below. - **Use Tables to create general layout of email** - Set the width of each cell in the table. - Avoid cell spacing and padding. - **Always set a "doctype" in your code** - **Set wrapper reset styles in "wrapper div"** - This can override a browser or client's default styling of certain elements. - Click [here](http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/) for more information on reset styles. - **Be aware of text and font changes per device (mobile especially) and browsers** - Mobile devices and different browsers may change the font styling to increase readability. - For example, *Comic Sans* is not supported on mobile devices. ## Backgrounds - **Use the older more basic background HTML tags** - "background-image" ; "bgcolor" ; "background" - Many browsers and clients experience issues when trying to support compound CSS values, so be sure to use individual values such as "background-image" and "background-repeat" - **Always offer reset background colors or fall back background colors to defer to if your specific background isn't supported** ## Images - **SendGrid Image Library** - .jpg, .gif, and .png files can be uploaded to the SendGrid Editor for use with Email Designs - **Always provide image dimensions** - Some mail clients will automatically apply their own if none are given which can lead to major issues when rendering these images in relation to spacing and alignment. - It is important to note however that some mail clients will do this regardless as a default setting. - **Make sure to give ALL of your images 'alt' attributes** - This simple step will keep the overall sizing of your images the same across platforms. - **Outlook.com adds some pixels at the end of each image which can rearrange spacing, alignment, or padding** - Use the "Outlook.com hack" - `img {display:block;}`. This removes the padding in outlook.com and gives predictable results across many other email clients in terms of added spacing or padding to images. - **Avoid 'float' tags** - Outlook cannot support these tags, so SendGrid recommends using align tags. For example, `<img src="image.jpeg" align="right">`. - Yahoo! has similar issues, so SendGrid recommends using align="top" for the image in question. ## Controlling converted plain text email output <call-out type="warning"> Due to low usage, this feature has been removed. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> *To control the output of plain-text conversion do one of the following:* 1. Turn off the filters causing the conversion from plain text to HTML. 1. Start each line with a space, this will add a "preformatted" `<pre>` tag around the line. 1. Separate new sentences with double newlines, which will add a "paragraph" `<p>` tag around the sentence. 1. Convert your message to HTML, bypassing our need to convert it all together. 1. To disable conversion globally, click **Mail Settings** and select **Plain Content** and enable the suppression. **Why can't you just automatically add `<br />` tags to newlines upon conversion?** Due to the way plain text emails are sent ( [RFC 5822](http://www.rfc-editor.org/rfc/rfc5322.txt "Link: http://www.rfc-editor.org/rfc/rfc5322.txt"), Revised 2008) mailers are required to wrap lines at 998 characters, and recommends wrapping at 78 characters (excluding CR/LF). As a result, long sentences can often be broken up into multiple lines. Adding `<br />` tags to each newline would create formatting problems. **For more information** We use the open-source library [MKDoc-Text-Structured](http://search.cpan.org/~bpostle/MKDoc-Text-Structured-0.83/lib/MKDoc/Text/Structured.pm) to perform the plain-text to HTML conversion. More information about this library and how it works can be found on the [MKDoc-Text-Structured documentation page](http://search.cpan.org/~bpostle/MKDoc-Text-Structured-0.83/lib/MKDoc/Text/Structured.pm). ## Videos - Many clients simply cannot support rendering video (other than GIFs) in their emails - JavaScript nor the object tag are supported in many clients or browsers and thus can't support video rendering If you're still having issues, please contact our support team for help. We can provide the tools and the knowledge base to help you understand what your mail will look like across platforms and how to gain insight in making them appear consistent across these platforms. ================================================ FILE: content/docs/ui/sending-email/deliverability.md ================================================ --- seo: title: Deliverability Overview description: Email Deliverability Overview keywords: spam, bulk, box, segmentation, folder, inbox, list, deliverability, best, practice, engagement, blocked, not, delivered, delivery, spammy, can, can-spam, deliver title: Deliverability Overview group: delivery-optimization weight: 0 layout: page navigation: show: true --- Below are some email deliverability tips and tricks from leading industry experts. While none of these are required, they all come highly recommended from SendGrid. Satisfying each of the below conditions is a great step toward resolving current or potential issues with email deliverability such as spam folder delivery or being added to a deny list. ## Who, What, When, Where, Why First and foremost, ask yourself this question: **Am I sending the right message to the right person at the right time with the right frequency?** Overall email deliverability is influenced by how your recipients interact with your messages. If your messages are opened in a timely manner, images are displayed and links are clicked, then mail providers will see you as a sender whose messages their recipients want to receive. If messages pile up, remain unopened or get marked as spam, mail providers won't be as comfortable placing your messages in the inbox or accepting them at all! <call-out-link linktext="EXPERT SERVICES" img="/img/expert-insights-promo3.png" link="https://sendgrid.com/solutions/expert-services/"> ### Need a helping hand? Getting into the inbox just so you can have the chance to engage with your customers often isn’t as easy as pressing “send.” Get customized advice from our team of email experts on how to optimize your email strategy. </call-out-link> ## Adhere to Standards The second biggest factor in inbox delivery is the actual content you send in your messages. It's very important to ensure your emails meet every CAN-SPAM requirement. Some key takeaways from [CAN-SPAM](https://www.ftc.gov/tips-advice/business-center/guidance/can-spam-act-compliance-guide-business): - Don't deceive your recipients. Be up front with who you are and what kind of messages you are sending. - Provide your recipients with a way to opt-out of messages. [Read the full CAN-SPAM Act here!](http://business.ftc.gov/documents/bus61-can-spam-act-compliance-guide-business) This is required reading for any aspiring email acolyte. ### "No, thank you." One of the most important parts of CAN-SPAM is this line: **"Tell recipients how to opt out of receiving future email from you."** All email providers look for an unsubscribe method (or links) in all emails. Even though it may not make sense for transactional mail, it can make the difference between messages arriving in the inbox or the spam folder. [Subscription tracking]({{root_url}}/ui/sending-email/subscription-tracking/) automatically inserts an unsubscribe link into all your emails and maintains the Unsubscribe list. Think of it this way: would you rather a recipient politely decline future emails from you or mark your messages as spam because they have no other option? ### Who are you? Maximum company visibility helps as well. Placing your company name in the subject line of your emails and including your physical mailing address and phone number in your email footers helps mail providers recognize you as a legitimate company and email sender. This also helps your recipients know that this message is indeed from you! We've all ignored phone calls from numbers we don't recognize, the same goes for email! <call-out type="warning"> CAN-SPAM actually requires you inform recipients of where you are located. </call-out> ### Segment your traffic Keeping your mail streams separated can make a huge difference in the long run. Specifically, [segmenting]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) your marketing email from your transactional email is a great way to keep legitimate mail out of trouble. Say, for example, you are sending your Daily Knitting Update emails on the same account and the same IP address as your receipts, invoices, and password resets. The day then comes where one of your recipients simply can't take it anymore and marks every single Daily Knitting email they've ever received from you as spam. Knitting overload! The potential fallback from this is that not only will that recipient no longer receive their important receipts, invoices, and password resets, but it then becomes possible that ALL recipients at the same domain or ISP may also run afoul of the same problem. Yikes! Consider setting up a [new Subuser account]({{root_url}}/ui/account-and-settings/subusers/) with an [additional dedicated IP address]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/) specifically for your marketing email, for example: * Parent account | IP 1 | Receipts, invoices, and password resets * Subuser account | IP 2 | Marketing/Promotional emails This simple division will keep your important email in the clear, even if one stream runs into trouble. Remember, don't cross the streams! ### Encourage recipients to trust you With email, things don't happen overnight, and magic wands are few and far between. So for the most part, the actions of your recipients are the highest voice of authority. Encouraging your recipients to do certain things can help bolster the trust ISPs have for you and your messages. Some examples can include: - "Add us to your address book!" - Having a recipient add your *from address* to their address book or trusted senders list can go a long way. More often than not, if one of an ISPs recipients trust a sender, they will be more lenient to similar messages to different recipients! - Star or Mark as important - A simple inbox action like this is just another way your recipients can tell their mail providers that "Hey, I want these messages". - IP Allow List - Some ISPs or mail admins can add rules to always allow _all_ incoming mail from specific IP addresses! Consider reaching out to the postmaster(usually example@example.com) of problematic mail domains to see if they can allow [your dedicated IP address]({{root_url}}/ui/account-and-settings/ip-access-management/). - "If you don't receive an email right away, please check your spam folder and mark "not spam" - Adding this simple sentence to your sign-up form area can solve a lot of potential heartache. If a message you sent ends up in the Spam folder, and the recipient manually goes in and pulls it out, that's fantastic! This not only helps an ISPs incoming mail filters in avoiding false positives, but also improves your standing with that ISP. ### Sending Adult Content If your business is adult in nature, we can send your mail to the same standards and deliverability as any of our other customers. However, **We do not allow our users to send explicit content within emails.** This applies primarily to images, but we reserve the right to refuse the sending of any type of content that we deem to be vulgar, pornographic, or otherwise explicit. If you are unsure where your emails stand, please contact our support team at [https://support.sendgrid.com](https://support.sendgrid.com) ## Nuts and Bolts ### Tips for Click Tracked links Our click tracking application can sometimes trip up spam filters. If you have click tracking enabled, we'll replace any links within HTML `<a>` tags with unique links that redirect through our service. As such, if you use the original link as the clickable link text in your `<a>` tag, when the click tracking link is replaced it creates irregularity between where the link appears to go and where it actually goes. For example the original link: `<a href="http://www.sendgrid.com">http://www.sendgrid.com</a>` Gets replaced with a much longer link with click tracking: `<a href="http://beertemp.sendgrid.net/wf/click?upn=a2quqXSHnxzJyDEtVGmF4w3cWg6voxuzvZ4oDr9WeNk-3D\_4MHh">http://www.sendgrid.com</a>` This is may look very similar to phishing emails, placing these messages in the spam folder rather than the inbox. To get around this, use something descriptive for the link text rather than the link itself in your messages: `<a href="http://www.sendgrid.com">Click to visit SendGrid</a>` ### Images and Attachments Also, consider how you include images and attachments in your messages. As it is impossible to know how a receiving server treats attachments, we recommend using the HTML `<img>` tag to include images in your messages and we also recommend linking to hosted files rather than including them as attachments. Images must be hosted on your own or on a public facing server to be included via the HTML `<img>` tag. Secure site logins or credentials can be used to track who is coming to your site to download files. This helps ensure that your message gets to the recipient regardless of any attachment restrictions on the receiving mail server. ## Tools of the Trade Finally, there are some great 3rd party services you can use to get an idea of how mail providers analyze your emails: * [http://isnotspam.com](http://isnotspam.com/) * [http://www.mail-tester.com/](http://www.mail-tester.com/) You can send emails to a capture address at one of these services and they will reply with a breakdown of all the positive and negative factors of your emails. This helps you isolate and fix specific issues that may be sending your email to the Spam folder rather than the inbox. These services are _HIGHLY recommended_ for troubleshooting **spam folder delivery.** [Senderscore](https://senderscore.org/) is another great resource you can use to get a good idea of how the internet email community ranks the [IP address you send mail from]({{root_url}}/ui/account-and-settings/ip-access-management/). SendGrid has also released their [2019 Email Deliverability Guide](https://sendgrid.com/marketing/guide-2019-deliverability-guide/) highlighting these and more deliverability tips. ================================================ FILE: content/docs/ui/sending-email/deny-lists.md ================================================ --- seo: title: What do I do if I'm added to a deny list? description: What do I do if I'm added to a deny list? keywords: dedicated, deny list, list, delist, best, blocked, BL, RBL, DNSBL title: What do I do if I'm added to a deny list? group: delivery-optimization weight: 0 layout: page zendesk_id: 200256676 navigation: show: true --- Ending up on a [deny list]({{root_url}}/glossary/deny-list/) can be detrimental to your domain’s email deliverability. These days, there are hundreds, maybe thousands of deny lists out there. Some, like the Spamhaus SBL, can have a great impact on your email deliverability, while others may not. Many of the world's largest inbox providers use deny lists to help them make inboxing and filtering decisions. Others rely only on their own internal metrics. No action should be taken with listing entities requesting a fee for delisting or stating they do not accept requests to delist. If you find that your IP address has been added to a deny list by a legitimate entity, then submitting a delisting request would be recommended. Depending on your plan, you should approach being added to a deny list in one of 2 ways: ## Shared IP Plans (Free, Legacy Lite, and Essentials) ### Spamhaus deny list If you are on one of our shared IP plans and you notice a block message from Spamhaus based on one of our IP addresses, please know that we are already working with Spamhaus directly to address the issue. There is no need to make an additional request through our support team. ### Other deny lists If you are on one of our shared IP plans and you notice a block message from any other deny list based on one of our IP addresses, please note that blocklists are a natural part of sending through shared IP Pools with multiple senders utilizing the same set of IPs. The large majority of these blocklists do not have an impact on your deliverability and often self-mitigate over time. We are actively monitoring these listings to ensure appropriate actions are taken for any that may impact our senders' deliverability. ## Dedicated IP Plans (Pro and Premier) We ask that our dedicated IP plan users make the initial delisting request in the event that they discover their SendGrid IP on a deny list. These IP addresses are only assigned to one account at a time, so we expect those users to take responsibility for all of the mail that is sent through their account. SendGrid will still be happy to step in and assist with these delisting requests if the listing service requires the IP administrator to take action, or if the delisting form is too complicated. <call-out> In the event that a sending domain (and not the IP address) is added to a deny list, the domain’s controller will be responsible for handling the delisting request. </call-out> ## Checking Your IP Address Here are 2 aggregation websites that anyone can use to check on the status of their IP: - [http://multirbl.valli.org/](http://multirbl.valli.org/) - [http://www.mxtoolbox.com/blacklists.aspx](http://www.mxtoolbox.com/blacklists.aspx 'Link: http://www.mxtoolbox.com/blacklists.aspx') ## Delisting Request Forms Below are links to the delisting forms used by the more popular external deny listing services: - [AT&T](http://rbl.att.net/cgi-bin/rbl/block_admin.cgi 'Link: http://rbl.att.net/end_user_request2.html')\* - [Barracuda](http://www.barracudacentral.org/rbl/removal-request) - [Cloudmark](https://csi.cloudmark.com/en/reset/) - [Comcast](http://postmaster.comcast.net/block-removal-request.html) - [Google](https://support.google.com/mail/contact/msgdelivery) - [McAfee](https://www.mcafee.com/enterprise/en-us/threat-center/threat-feedback.html) - [Microsoft/Outlook](https://support.microsoft.com/en-us/getsupport?oaspworkflow=start_1.0.0.0&wfname=capsub&productkey=edfsmsbl3&locale=en-us&ccsid=635996265829568030&forceorigin=esmc) - [Mimecast](http://www.mimecast.com/senderfeedback) - [Office365](https://sender.office.com/) - [ProofPoint](https://support.proofpoint.com/dnsbl-lookup.cgi) - [SORBS](http://www.sorbs.net/overview.shtml) - [SpamCop](http://www.spamcop.net/bl.shtml) **†** - [Spam Rats](http://www.spamrats.com/removal.php) - [Spamhaus](http://www.spamhaus.org/lookup/) - [SURBL](http://www.surbl.org/surbl-analysis) - [Trend Micro](https://ers.trendmicro.com/reputations) - [URIBL](https://admin.uribl.com/) <call-out> If you request a delisting from a deny listing service, and don't do anything to change the behavior that caused the listing in the first place, it is likely to occur again. Depending on the list, it can be progressively harder to get delisted after the second or third listing. </call-out> <call-out type="warning"> Don't delist from major deny lists without a plan in place to address the issue that caused the listing! [Learn more about how to avoid and mitigate risk of being added to a deny list here](https://sendgrid.com/blog/avoiding-email-blacklists/). </call-out> <call-out-link linktext="EXPERT SERVICES" img="/img/expert-insights-promo3.png" link="https://sendgrid.com/solutions/expert-services/"> ### Need a helping hand? Getting into the inbox just so you can have the chance to engage with your customers often isn’t as easy as pressing “send.” Get customized advice from our team of email experts on how to optimize your email strategy. </call-out-link> ================================================ FILE: content/docs/ui/sending-email/dmarc.md ================================================ --- seo: title: Everything about DMARC description: Everything about DMARC keywords: security, secure, dmarc, spf, dkim, sender verification, wizard, rua, reject, quarantine title: Everything about DMARC group: delivery-optimization weight: 0 layout: page navigation: show: true --- This article provides an overview of Domain-based Message Authentication, Reporting and Conformance (DMARC). You will learn how DMARC works and how it applies to your Sender Identity or From address. You should already be familiar with [DNS records]({{root_url}}/glossary/dns/), [IP addresses]({{root_url}}/glossary/ip-address/), and the general [flow of web traffic](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/How_does_the_Internet_work) to get the most from this article. If you need a refresher on these topics, resources are linked throughout this page. ## What is DMARC? DMARC is a powerful way to verify the authenticity of an email’s sender and prevent malicious senders from damaging your sender reputation. To understand DMARC, let's first understand the problem DMARC attempts to solve: email spoofing. Email spoofing is the practice of sending email with a forged From address. Note that an email actually has two From addresses: the Header From and Envelope From. DMARC is concerned only with the spoofing of the Envelope From (also known as the `return-path`) address. See our [spoofing glossary entry]({{root_url}}/glossary/spoofing/) for more information about spoofing and From addresses. DMARC relies on two authentication protocols to prevent spoofing: Sender Policy Framework (SPF) and DomainKeys Identified Mail (DKIM). <call-out> Twilio SendGrid now offers additional DMARC enforcement and monitoring options in partership with [Valimail](https://go.valimail.com/TwilioSendGrid.html). Click [here](https://sendgrid.com/blog/twilio-launches-partnership-with-valimail-dmarc-solutions-to-deploy-sophisticated-anti-phishing-technologies-at-scale/) for more information. </call-out> ## Sender Policy Framework The strategy employed by SPF is to add a [TXT record](https://en.wikipedia.org/wiki/TXT_record) to a domain’s [DNS](/glossary/dns/). The TXT record specifies which IP addresses are allowed to send email for the domain. ### SPF mail flow Imagine an email server receives a message and checks the Envelope From (`return-path`). The return path is `sender@example.com`. To perform an SPF check, the following steps take place. 1. The receiving email server retrieves the SPF record from the DNS records for the `example.com` domain. 2. The receiving server then checks the SPF record for all the IP addresses that are approved to send email on behalf of the domain. 3. If the SPF check passes, the receiving server can be confident the message was sent from an approved sending server and will continue processing the message. 4. If the SPF check fails, the message is likely illegitimate and will be processed using the receiving server’s failure process. ![A diagram of the SPF traffic flow described in the steps above this image]({{root_url}}/img/spf_mail_flow.jpeg "SPF mail flow diagram") For more on SPF, see [SPF Records Explained](/ui/account-and-settings/spf-records/). ## DomainKeys Identified Mail DomainKeys Identified Mail (DKIM) uses [public-key cryptography](https://www.twilio.com/blog/what-is-public-key-cryptography) to sign a message. Like SPF, DKIM is implemented with a TXT record. Unlike SPF, the DKIM TXT record provides a public key that receiving mail servers can use to verify the authenticity of a message. Remember, the problem with spoofing is forgery of the From address. However, by signing the From address, among other headers, and providing a public key to verify the signature, receiving servers can corroborate the authenticity of the sender. ### DKIM mail flow Let’s again imagine an email sent by `sender@example.com`. For DKIM to work properly, the following steps take place: 1. Before sending the message, the sending server signs the email using a private key. 2. When the message is delivered, the receiving server obtains the DKIM record from the DNS records for `example.com`. 3. The receiving server then uses the public key in the DKIM record to verify the message’s signature. 4. If the DKIM check passes, the receiving server can be confident the message was sent by the address in the `return-path` and wasn’t altered in transit. 5. If the DKIM check fails, the message is likely illegitimate and will be processed using the receiving server’s failure process. ![A diagram of the DKIM traffic flow described in the steps above this image]({{root_url}}/img/dkim_mail_flow.jpeg "DKIM mail flow diagram") For more information about DKIM, see [DKIM Records Explained](/ui/account-and-settings/dkim-records/). ## Domain-based Message Authentication, Reporting and Conformance If SPF and DKIM already help validate an email's sender, what does DMARC add? ### Why we need DMARC Think of DMARC _not_ as an independent authentication protocol but as a framework for handling SPF and DKIM failures and reporting those failures to domain owners. * DMARC allows domain owners to specify what should happen if either or both SPF and DKIM checks fail. Neither SPF nor DKIM provide this functionality on their own. This means that without DMARC a sender has no say in whether a failing message is bounced, sent to a spam folder, or handled in some other way. * A sender receives no feedback about SPF and DKIM failures without DMARC, so senders have little chance to combat or even understand the delivery trends of their domain, often called a "[reputation monitoring](/glossary/reputation-monitoring/)." * SPF and DKIM are independent of each other, but neither provide thorough spoofing protection on their own. DMARC addresses these issues by building on top of SPF and DKIM. SPF and DKIM handle the Domain-based Message Authentication part of DMARC. DMARC adds the Reporting and Conformance piece on its own. Like SPF and DKIM, DMARC is implemented using a TXT DNS record. This record allows receiving email servers to fetch failure processing instructions from domain owners. ### DMARC Records <call-out> "If you know how to view DNS records (e.g. using the 'dig' command), you can also check to see if [service providers] publish a DMARC TXT Resource Record. This doesn’t necessarily mean they support DMARC for the email they receive (though it’s a good indication), but it does indicate they use DMARC to protect outbound mail." — [DMARC.org](https://dmarc.org/wiki/FAQ) </call-out> #### Example DMARC record ```text v=DMARC1\;p=none\;rua=mailto:dmarc@sendgrid.com\;ruf=mailto:dmarc@sendgrid.com\;rf=afrf\;pct=100 ``` A DMARC record contains several tags separated by semicolons, ;. Two of the tags are required, `v` (version) and `p` (policy). ##### Version tag The version, `v=DMARC1`, tells receiving servers that the DNS TXT record is a DMARC record. ##### Policy tag The policy, `p`, can be one of three values, `none`, `quarantine`, or `reject`. DMARC policies are the mechanism domain owners use to specify how a receiving email server should handle SPF and DKIM failures. 1. `p=none`: No action should be taken. Even if a failure occurs, the message should be delivered. Though no action is taken on the message, the failure is included in reports sent to the domain owner. 2. `p=quarantine`: Failures should be quarantined. This usually means the message is sent to the spam folder. Again, the failure will be included in reports to the domain owner. 3. `p=reject`: Failures will be rejected. This usually means that the message will be deleted. The message may also be bounced to the Envelope From address. ##### Report and report-related tags Where do the failure reports go? The address assigned to `rua=` tells receiving email servers where to deliver aggregate reports. The address assigned to `ruf=` tells receiving email servers where to send forensic reports. 1. Aggregate reports are sent daily by default and don’t include detailed information about individual failures. 2. Forensic reports send detailed information about individual failures at the time of failure. The email address assigned to `ruf` must also use the domain on which the DMARC record exists. The request format, `rf=afrf`, tells receiving servers how to format reports for the domain owner. [Authentication Failure Reporting Format](https://tools.ietf.org/html/rfc6591), `afrf`, is the default and is an extension of [Abuse Reporting Format](https://en.wikipedia.org/wiki/Abuse_Reporting_Format). The `fo` tag tells receiving servers what type of failures to report. There are four possible values for this tag. 1. `fo=0`: Send a report if _both_ SPF and DKIM checks do not pass. This is the default value. 2. `fo=1`: Send a report if _either_ SPF or DKIM checks do not pass. 3. `fo=d`: Send a report only if the DKIM check does not pass. 4. `fo=s`: Send a report only if the SPF check does not pass. The `ri` tag sets the interval in seconds at which a domain owner wishes to receive aggregate reports. The default is, `86400`—that’s 24 hours in case you don’t have your calculator out. ##### Alignment tags There are tags for both SPF, `aspf`, and DKIM, `adkim`, alignment. Alignment is a way of qualifying how strictly DKIM and SPF values should be applied to pass a check. The options are either `s` for strict or `r` for relaxed. * Strict: Only `return-path` domains that match the domain set in the SPF or DKIM record exactly will pass. * Relaxed: Any `return-path` domain matching the root of the domain set in the SPF or DKIM record will pass. This allows [CNAME](/glossary/cname/) addresses to pass a check. ##### Subdomain tag If a domain owner needs to specify different policies for subdomains, they can use the `sp` tag. Like the policy tag, `p`, the possible values for the `sp` tag are `none`, `quarantine`, and `reject`. This means you can, for example, apply a reject policy to your root domain and a quarantine policy for all its subdomains. ##### Percent tag The percent tag, `pct`, specifies the percentage of email to which your DMARC policy will be applied. The possible values are `1` through `100`. For example, if your policy is set to `quarantine`, and your percent is set to `50`, half of all failing mail will be quarantined. This tag value can be adjusted as you learn more about DMARC failures on your domain. ### DMARC mail flow ![A diagram of the DMARC mail flow]({{root_url}}/img/dmarc_mail_flow.jpeg "DMARC mail flow diagram") ## How DMARC Applies to a Sender Identity When sending email via a service provider such as SendGrid, you will be asked to [authenticate a domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) or [verify a Single Sender]({{root_url}}/ui/sending-email/sender-verification/#adding-a-sender). However, what happens if you verify a Sender Identity using a `gmail.com`, `yahoo.com`, `aol.com`, or a similar address? In other words, what happens if your Envelope From address is `sender@gmail.com`? As you can guess, major mail providers such as Google, Microsoft, and others implement DMARC to protect their customers and prevent abuse. Let's use Yahoo and the email address `sender@yahoo.com`, as an example. Yahoo has SPF, DKIM, and DMARC policies. Yahoo’s DNS records will approve domains such as yahoo.com and the IP addresses Yahoo controls. SendGrid domains and IP addresses will not be included in Yahoo's approved domains and IP addresses. When you send a message from `sender@yahoo.com` to `customer@gmail.com` using SendGrid, a Gmail server will receive the message. Gmail will then look up Yahoo’s SPF and DKIM records because `yahoo.com` is the domain in the return-path message header. The Gmail receiving server will determine that the message was sent using a SendGrid IP address and was not signed by a Yahoo private key. Both SPF and DKIM will fail, causing Gmail to employ the DMARC failure policy specified by Yahoo. Essentially, Gmail, or any other receiving email server, has no way of knowing whether you are using SendGrid to send email for legitimate purposes or spoofing Yahoo's domain. This is why SendGrid recommends [authenticating a domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) that you _do_ control. The SendGrid domain authentication process provides CNAME records that you place on your own domain to approve SendGrid's IP addresses. SendGrid will automatically manage your SPF and DKIM records, protecting your domain’s reputation. ### Popular email providers that enforce DMARC Many of the popular email providers implement DMARC, including: * AOL * Gmail * Microsoft (Hotmail, MSN) * Outlook * Yahoo Providers with DMARC policies may reject email with messages like, **"521 5.2.1 : (DMARC) This message failed DMARC Evaluation and is being refused due to provided DMARC Policy"**. If you see a bounce with one of these failure messages, the message has been discarded and tracked as a [Block](http://sendgrid.com/blocks). You will need to adjust your From address field settings, and then try resending from your side. ## Additional Resources * [How to Implement DMARC]({{root_url}}/ui/sending-email/how-to-implement-dmarc/) * [Sender Identity](/for-developers/sending-email/sender-identity/) * [Domain Authentication](/ui/account-and-settings/how-to-set-up-domain-authentication/) * [Single Sender Verification](/ui/sending-email/sender-verification/) * [DMARC.org](https://dmarc.org/) ================================================ FILE: content/docs/ui/sending-email/editor.md ================================================ --- layout: page weight: 81 title: Design & Code Editor group: building-email navigation: show: true seo: title: Design & Code Editor override: true description: Twilio SendGrid Marketing Campaigns' editing gives you complete control over your emails. Use a flexible drag-and-drop Design editor or a robust HTML code editor. --- <iframe src="https://player.vimeo.com/video/388548001" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> The Twilio SendGrid email design experience is all about supporting your unique workflow, so you can get things done more efficiently. You have complete control over the way that you create and edit each new email, thanks to our two distinct editing experiences. ## Choosing the right editor Both editors provide access to similar features, and you can achieve the same results with either editor. Which editor you choose will mostly be determined by the way you like to work. A brief description of the editors and their shared functionalities is provided below. The user interfaces are similar but have some differences. How to work with the editors is detailed in the editor-specific sections below. The [**Code Editor**](#the-code-editor) is perfect for users who are importing, creating, or editing custom HTML. It offers a robust environment to upload images, backed by a feature-packed editor – complete with split-screen preview, error flagging, scroll-syncing, syntax highlighting, and more. While other email editors may be notorious for adding excess code to your project, rest assured that our editor never modifies your carefully crafted HTML. The [**Design Editor**](#the-design-editor), complete with HTML access to each content module, offers powerful _what you see is what you get_ (WYSIWYG) editing. It features a diverse library of content blocks, allowing you to build beautiful emails quickly and intuitively. Once placed into your email, each module offers access to edit the HTML and a robust panel of settings–perfect for customizing content precisely to your needs. <call-out> The [Design Editor](#the-design-editor) features a number of convenient ways to edit the HTML content of your email, including the ability to [edit the HTML of each drag-and-drop module](#editing-module-html), [edit the HTML `head` of your message](#editing-the-html-head), and even import complete code using our [drag and drop markup](#importing-custom-html-with-drag--drop-markup). </call-out> <call-out type="warning"> Twilio SendGrid recommends only having one instance of a template or Marketing Campaigns email open in one instance of the editor at a time. Multiple instances in different browsers or computers will cause autosave to undo changes, and there is no recovery option. </call-out> ## Shared editor features ### Dynamic data with Handlebars Both editors support dynamic data using [Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) syntax. Dynamic data includes any information you use to personalize a design, such as a customer's name or order confirmation number. You can use test data in the editor's preview to ensure your dynamic values behave the way you expect before you ever send a message. In addition to substituting values, you can use Handlebars in your designs to [format dates]({{root_url}}/for-developers/sending-email/using-handlebars/#formatdate), [iterate over lists]({{root_url}}/for-developers/sending-email/using-handlebars/#iterations), and [conditionally render values]({{root_url}}/for-developers/sending-email/using-handlebars/#conditional-statements). See our [Handlebars documentation]({{root_url}}/for-developers/sending-email/using-handlebars/) to see all that you can do with dynamic data and Twilio SendGrid templates. ### Substitution Tags Substitution Tags allow you to use any reserved or custom field data you've added to Marketing Campaigns to dynamically generate unique content for each recipient of your email. A common example is to add a recipient's first name to the body (or even the subject line) of your email. The data that populates your Substitution Tags will come from the information you have stored about each contact. You can manage this information on the [Marketing Campaigns Contacts page](https://mc.sendgrid.com/contacts). In addition to the following reserved fields that are available on all contacts by default, you can add your own [Custom Fields](https://mc.sendgrid.com/custom-fields) with Marketing Campaigns. When building Marketing Campaigns designs, your Custom Fields will be available in the **Tags** tab of the editors. For information about managing these fields, see our [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) documentation. <call-out> For contacts with no entry in a custom field, the Substitution Tag appears blank. To set a default value, use the following pattern: `{{insert first_name "default=Valued Customer"}}` </call-out> #### Reserved Substitution Tags The following Tags are provided by Twilio SendGrid by default and are available on each of your contacts. <table class="table" style="table-layout:fixed"> <tr> <th>Substitution Tag</th> <th>Description</th> </tr> <tr> <td><code class="language-text">{{first_name}}</code></td> <td>The first name of the recipient</td> </tr> <tr> <td><code class="language-text">{{last_name}}</code></td> <td>The last name of the recipient</td> </tr> <tr> <td><code class="language-text">{{email}}</code></td> <td>The email address of the recipient</td> </tr> <tr> <td><code class="language-text">{{alternate_emails}</code></td> <td>Alternate emails of the recipient</td> </tr> <tr> <td><code class="language-text">{{address_line_1}}</code></td> <td>The first line of the address of the recipient</td> </tr> <tr> <td><code class="language-text">{{address_line_2}}</code></td> <td>The second line of the address of the recipient</td> </tr> <tr> <td><code class="language-text">{{city}}</code></td> <td>The city of the recipient</td> </tr> <tr> <td><code class="language-text">{{state_province_region}}</code></td> <td>The region of the recipient</td> </tr> <tr> <td><code class="language-text">{{postal_code}}</code></td> <td>The postal code of the recipient</td> </tr> <tr> <td><code class="language-text">{{country}}</code></td> <td>The country of the recipient</td> </tr> <tr> <td><code class="language-text">{{phone_number}}</code></td> <td>The phone number of the recipient</td> </tr> <tr> <td><code class="language-text">{{whatsapp}}</code></td> <td>The whatsapp of the recipient</td> </tr> <tr> <td><code class="language-text">{{line}}</code></td> <td>The line of the recipient</td> </tr> <tr> <td><code class="language-text">{{facebook}}</code></td> <td>The facebook of the recipient</td> </tr> <tr> <td><code class="language-text">{{unique_name}}</code></td> <td>The unique name of the recipient</td> </tr> <tr> <td><code class="language-text">{{Sender_Name}}</code>* </td> <td>The name of the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_Email}}</code>* </td> <td>The email of the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_Address}}</code>* </td> <td>The address on record for the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_City}}</code>* </td> <td>The city on record for the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_State}}</code>* </td> <td>The state on record for the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_Zip}}</code>* </td> <td>The zip code on record for the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text">{{Sender_Country}}</code>* </td> <td>The country on record for the sender selected when sending your email</td> </tr> <tr> <td><code class="language-text"><%asm_group_unsubscribe_<br>raw_url%></code>* </td> <td>This tag is replaced with a link allowing your recipients to opt out of any emails you send using the chosen Unsubscribe Group</td> </tr> <tr> <td><code class="language-text"><%asm_global_unsubscribe_<br>raw_url%></code>* </td> <td>This tag is replaced with a link allowing your recipients to opt out of all email communication</td> </tr> <tr> <td><code class="language-text"><%asm_preferences_<br>raw_url%></code>* </td> <td>This tag is replaced with a link allowing your recipients to opt out of any email unsubscribe groups you offer.</td> </tr> <tr> <td><code class="language-text">{{Weblink}}</td> <td>This tag is replaced with a link that will open the email in a Twilio SendGrid-hosted webpage. This feature makes it possible to view an email when an email client fails to open or properly render the message.</td> </tr> </table> \* For your convenience, these substitution tags are included by default in the Unsubscribe Module found on the Tags tab of the Design Editor. <call-out type="warning"> The `<%asm_group_unsubscribe_raw_url%>`, `<%asm_preferences_raw_url%>`, and `<%asm_global_unsubscribe _raw_url%>` tags are reserved for use in Transactional Templates and should not be used in Marketing Campaigns. </call-out> _See how to work with Substitution Tags_ - [Using the Code Editor](#using-substitution-tags-with-the-code-editor) - [Using the Design Editor](#using-substitution-tags-with-the-design-editor) ### Test data The Design and Code Editors both provide a test data preview feature. This means you can add the reserved and custom fields stored on a contact as well as any other variables you wish to pass into your template, such as order confirmation data. Test data provides a way to be sure that your final design will populate and render the substitutions properly. If you wanted to collaborate on a design for example, having test data stored directly in the design means each teammate can reference the data structure used to populate substitution tags without having to dig into a code base. _See how to work with Test Data_ - [Using the Code Editor](#test-data-with-the-code-editor) - [Using the Design Editor](#test-data-with-the-design-editor) ### Categories <call-out type="warning"> Category information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> Assigning categories to a single send allows you to track emails based on your own categorization system. By assigning your single send to a category, you can track statistics across multiple similar Single Sends and Automations. For example, you might have categories like “Weekly Digest” or “Product Announcements.” <call-out> Currently, only 10 categories can be added to each single send. </call-out> _See how to add categories_ - [Using the Code Editor](#adding-categories-with-the-code-editor) - [Using the Design Editor](#adding-categories-with-the-design-editor) ### Email Testing Email testing offers robust, pre-send testing of your emails, including in-app spam testing, inbox rendering previews, and link validation right within your Marketing Campaigns workflow. It allows you to preview how an email is likely to perform across a wide range of inbox providers, devices, and spam filters before sending. For more information, see our dedicated [email testing documentation]({{root_url}}/ui/sending-email/email-testing/). ### Undo and redo functionality Both editors provide undo and redo functionality using the undo and redo buttons at the top of the editor UI or with keyboard shortcuts. _Undo/redo keyboard shortcuts_ - **Undo**: `Command` or `Control` + `Z` - **Redo**: `Command` or `Control` + `Shift` + `Z` ![Undo and redo buttons]({{root_url}}/img/editors_undo_redo.png 'Undo/Redo') ## The Code Editor Twilio SendGrid’s marketer-friendly code editor features a powerful split-screen editing experience – perfect for building Single Send or Automation emails with your own custom HTML. It offers a number of helpful features, often found in full-featured code editors. ### Code Editor Features #### Live template preview See how your email looks in real-time as you write and edit code. No more tabbing between windows, refreshing, or re-rendering. Marketing Campaigns’ split-screen editing experience displays your code on the left and a pixel-perfect preview on the right. #### Error flagging If the code editor finds something that seems odd or inconsistent with best practices, instead of interrupting your workflow, it places a small red “x” in the margin of the line so you can come back and check when it’s convenient for you. #### Scroll syncing Easily pinpoint the HTML element you wish to edit. Click anywhere on the right-side preview of your email, and the code on the left automatically jumps to the corresponding line. Click somewhere on the left, and the preview on the right will jump along with you. #### Syntax highlighting As you edit, parts of your code highlight in various colors according to the type of syntax. This added dimension provides clarity and efficiency as you search for, locate, and edit code elements. ### Getting Started With The Code Editor _To use the code editor for Single Sends:_ 1. From the left-hand navigation, select **Marketing**, and then click **Single Sends** 1. Click **Create a Single Send**. <br>To create a Single Send email using an existing (drafted or sent) email, find the Single Send you'd like to use and click the action menu next to the email. 1. Then, select **Edit** or **Duplicate**. 1. Select **Code Editor**, and then click **Continue**. _To use the code editor for Automations:_ 1. From the left-hand navigation, select **Marketing**, and then click **Automations** . 1. Click **Create an Automation**. 1. Under Custom Automation click **Select**. <call-out> The Welcome Series Automation can only be edited with the [Design Editor]({{root_url}}/ui/sending-email/editor/#the-design-editor) </call-out> 1. Give the automation a name, entry criteria, exit criteria, and select an [Unsubscribe Group](https://sendgrid.com/docs/ui/sending-email/create-and-manage-unsubscribe-groups/). 1. Select the send time and then click the edit button next to _Email 1_. 1. Select **Code Editor**, and then click **Continue**. <call-out> You can only edit unsent emails. </call-out> You can select a blank template, a custom template that you have already created, or one of Twilio SendGrid's pre-built templates. For more information, see [Working With Templates]({{root_url}}/ui/sending-email/working-with-marketing-templates/). If you have already built the HTML that you want to use in another application, copy and paste that code directly into the content area of the Code Editor. You can also write the HTML for your email or template directly in the Code Editor. The split-screen view of the Code Editor allows you to see a real-time preview of your email. You can toggle between a preview of how your email or template appears on a recipient’s desktop and mobile phone by clicking either the desktop or mobile phone icons above the content area. You can also view a plain text version of your email or template by clicking the **T** icon. When in this preview mode, you can edit the plain text content of your email or template by clicking the **Edit Plain Text** button. <call-out type="warning"> Once you create a new single send or automation email in the Code Editor, it cannot be edited using the Design Editor unless you add our [Drag and Drop Markup]({{root_url}}/ui/sending-email/editor/#drag--drop-markup). </call-out> ### Uploading images with the Code Editor 1. Select the **images** icon above the HTML code. A window opens where you can upload images to your library. 2. Select the image you want to add from your image library. 3. Select the **image details** tab and copy the URL in the **Image Source URL** tab by clicking **Copy URL**. 4. Paste this URL in an image source tag in your email or template's HTML. ```html <img src="your image URL here" /> ``` ### Using Substitution Tags with the Code Editor _To add a substitution tag to your email:_ 1. Click the **Settings** tab on the left side of the editor. 2. Click the **Tags** tab at the top of the **Settings** window. 3. Locate the tag you want to add to your email and click it to automatically copy it to your clipboard. 4. Paste the tag into the email. When copying and pasting a tag from the **Tags** tab, a default will be added automatically. Default values are supported by the `insert` keyword only. For this reason, tags with default values will be saved with a different syntax automatically. For more information about working with default values and Handlebars, see [Adding Dynamic Content with Handlebars in Marketing Campaigns]({{root_url}}/ui/sending-email/adding-dynamic-content-with-handlebars-in-marketing-campaigns/). ### Test data with the Code Editor 1. To access the test data preview from the editor, click **preview** and then **Show Test Data**. ![The Code Editor's Test Data tab with a side-by-side view of the design and a window to place your test data]({{root_url}}/img/code_editor_test_data_tab.png 'Test Data') You can place the data for any tags in your design into the Test Data window. Note that the data must be in JavaScript Object Notation (JSON) format which is shown below. JSON is a way of structuring data in a collection of key/value pairs. For example, if you use the `first_name` substitution tag, `first_name` is the key and the customer's name is the value. The following sample code can be copied into **Test Data** to show a number of reserved fields. You can add to the list following the same format to capture any of your custom fields that are used as tags in your design. ```json { "first_name": "Tira", "last_name": "Misu", "email": "recipient@example.com", "alternate_emails": "recipient+@example.com", "address_line_1": "1234 N. Real Ave.", "address_line_2": "Suite 200", "city": "Denver", "state_province_region": "CO", "postal_code": 80202, "country": "United States" } ``` 4. Once you have test data in place, the preview on the right pane will render your test data within your design as it would appear for recipients. ![A side-by-side view of the test data and the rendered values in the template]({{root_url}}/img/code_editor_test_data_replaced.png 'Rendered test data') ### Adding Categories with the Code Editor <call-out type="warning"> Category information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> _To add categories to a Single Send_ 1. Click the **Settings** panel located on the left-hand side of the window to expand it. 1. Navigate to the **Settings** tab, and click **Single Send Settings** to expand the menu. 1. Locate the **Categories** field under **Single Send Settings**. 1. Select the **Add Categories** field. Type in the tag that you'd like to add, and press enter. ## The Design Editor SendGrid’s flexible design editor allows you to build your templates and emails using intuitive, drag & drop tools. The _what you see is what you get_ (WYSIWYG) editing experience features a library of modules for easily adding content to your email. ### Getting Started with the Design Editor _To use the design editor for Single Sends:_ 1. From the left-hand navigation, select **Marketing**, and then click **Single Sends** 1. Click **Create a Single Send**. <br>To create a single send email using an existing (drafted or sent) email, find the Single Send you'd like to use and click the action menu next to the email. 1. Then, select **Edit** or **Duplicate**. 1. Select **Design Editor**, and then click **Continue**. _To use the design editor for Automations:_ 1. From the left-hand navigation, select **Marketing**, and then click **Automations** . 1. Click **Create an Automation**. 1. Determine whether you’d like to send a pre-made "Welcome" series or a custom Automation and then click **Select**. 1. Give the automation a name, entry criteria, exit criteria, and select an unsubscribe group. 1. Select the send time and then click the edit button next to **Email 1**. 1. Select **Design Editor**, and then click **Continue**. <br>The Design Editor opens. 1. Select the template that you want to use for your email. <br>You can select a **Blank Template**, a custom template that you have already created, or one of Twilio SendGrid’s pre-built templates. For more information, see [Working With Marketing Templates]({{root_url}}/ui/sending-email/working-with-marketing-templates/) 1. Select **Design Editor** and then click **Continue**. <br>The Design Editor opens. ### Using drag and drop modules Drag and drop editing helps you swiftly construct your email, using pre-built content modules. You can edit individual modules in the left sidebar and reorder modules in your email body by clicking and dragging your mouse. _To add a drag & drop module:_ 1. Navigate to the **Build** tab and then click **Add Modules**. ![]({{root_url}}/img/design_editor_drag_drop.png 'Drag and drop editor') 2. Find the module tile you want to add to your email. Then, drag and drop it into your content area. 3. Edit the module settings and add your custom content to build your email. ### Drag and drop module descriptions and styles <table class="table" style="table-layout:fixed"> <tr> <th>Module</th> <th>Description</th> <th>Unique Style Options</th> </tr> <tr> <td>Button</td> <td>A clickable button that links to a URL.</td> <td>button color, border color, font color, width, height, padding, border radius, font size, button text, button URL, alignment,container background, container padding</td> </tr> <tr> <td>Columns</td> <td>The Columns module comprises multiple column layouts. When you drag a column module into your design, you will be presented with layout options. Each layout provides a number of columns distributed among common width ratios. Available layouts include evenly distributed 1, 2, 3, and 4 columns, 1:2 and 2:1 columns, 1:3 and 3:1 columns.<br><br> Within a column there are multiple drop zones for other non-column modules such as images, buttons, and text.</td> <td>container background, container padding, cell padding, columns</td> </tr> <tr> <td>Code</td> <td>This is an "anything goes" module where you can enter your own custom HTML.</td> <td>Module styles are not available for code modules.</td> </tr> <tr> <td>Text</td> <td>Can contain text, tables, and images.</td> <td>Background color, padding, line height</td> </tr> <tr> <td>Image</td> <td>Can contain a single image. Data attributes can be inserted directly in the <img> tag.</td> <td>Image background, image margin, link url, alt text, alignment, responsive, height, width</td> </tr> <tr> <td>Image and Text</td> <td>This is a columns module with 2 columns - each can contain either an image or some text.</td> <td>Image, image position, image background, image margin, text background, text margin</td> </tr> <tr> <td>Spacer</td> <td>Allows you to insert spacing between other modules.To add spacing using this module, simply adjust the padding in the <td> tag. For example, the spacer module adds a spacing of 50 pixels.</td> <td>Background color, spacing (padding-bottom)</td> </tr> <tr> <td>Divider</td> <td>A visual divider, or horizontal rule, that can be placed between modules.</td> <td>Background color, line color, height, padding</td> </tr> <tr> <td>Social</td> <td>Icons that allow for social media integration within your emails.The module offers 5 different social media icon options (Facebook, Twitter, Instagram, Google+, and Pinterest) all of which can be toggled on or off as well as fully customized to match individual branding and design standards. </td> <td>URL, size, border radius, and icon ( Facebook, Twitter, Instagram, Google+, and Pinterest).</td> </tr> <tr> <td>Unsubscribe</td> <td>This module is pre-populated with your sender information and a hyperlink to the `{{{unsubscribe}}}` tag which are required in order to be compliant with anti-spam laws. If you are using transactional templates, you need to include sender information the JSON array. For more information, see [How to Send Email with Dynamic Transactional Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/.</td> <td>Background color, padding, line height, font, font size, link color, alignment, Address Line, Unsubscribe Settings.</td> </tr> </table> ### Using global styles In addition to editing the styles for individual modules within your email/template, you may also make changes to the global styling of your entire email/template. This includes attributes such as the background color, text color, or font family. The email body is the entire area that your email or template fills inside your recipient’s browser or email inbox. Under the **Global Styles** dropdown menu in the left hand sidebar, click **Email Body** or **Content Container** to view and edit the following styles: <table class="table" style="table-layout:fixed"> <tr> <th>Global Style</th> <th>Style Options</th> </tr> <tr> <td><b>Email Body</b></td> <td><p><b>Background Color</b> - This is the color for the background of your entire email/template.</p> <p><b>Text Color</b> - This is the color of all text in your email/template. </p> <p><b>Link Color</b> - This is the color of all links in your email/template.</p> <p><b>Font Family</b> - This is the font family to be used for all text in your email/template.</p> <p><b>Font Size</b> - This is the default font size to be used for all text in your email/template.</p> </td> </tr> <tr> <td><b>Content Container</b></td> <td><p><b>Width</b> - This is the width of the container for your entire email/template. Your modules are all contained within these dimensions.</p> <p><b>Background Color</b> - This is the color of the area containing your modules.</p> <p><b>Padding</b> - This is the amount of space that you want between your modules and the boundaries of the content container.</p></td> </tr> </table> ### Editing module HTML _To edit Module HTML:_ 1. Select the module in the design editor and click the **< >** icon. <br>A window opens where you can edit the module HTML. 1. When you are finished editing the HTML, click **Update**. <call-out> If you make any structural code changes, you need to convert the module to a code module. </call-out> ### Code modules The code module is a unique drag and drop module that allows you to insert any custom HTML in your email as a single module which can be relocated and edited. <call-out type="warning"> The Design Editor does not modify or validate any HTML inserted via a code module. Please be careful when using custom HTML. Always preview your email before sending it. </call-out> ### Adding images with the Design Editor _To upload an image:_ 1. Navigate to the **Build** tab and then click **Add Modules**. 1. Select the Images module and drag and drop it into your content area. <br>This opens a window where you can upload images to your image library. 1. Drag and drop the image you want to use from your files or select **Choose images** to upload. _To insert an image:_ 1. Navigate to the **Build** tab and then click **Add Modules**. 1. Drag and drop the **Images** module into your content area. <br>A window opens where you can select images from the image library. 1. Select the image you want to add to your email. <br>The Image Details tab opens. 1. Insert your image in the email by clicking **Save Image**. ### Using Substitution Tags with the Design Editor _To add a substitution tag to your email:_ 1. Navigate to the **Tags** tab. 1. Locate the tag you want to add to your email and click the **copy** icon. 1. Paste the tag into the module. When copying and pasting a tag from the **Tags** tab, a default will be added automatically. Default values are supported by the `insert` keyword only. For this reason, tags with default values will be saved with a different syntax automatically. For more information about working with default values and Handlebars, see [Adding Dynamic Content with Handlebars in Marketing Campaigns]({{root_url}}/ui/sending-email/adding-dynamic-content-with-handlebars-in-marketing-campaigns/). #### Test data with the Design Editor 1. To access the test data preview, open a design in the Design Editor and select the **Preview** tab. 2. With the **Preview** tab active, you will see a **{} Show Test Data** button on the left. Click this button to open the test data window. ![The Design Editor's Preview tab with the {} Show Test Data button highlighted]({{root_url}}/img/design_editor_show_test_data.png '{} Show Test Data') 3. You will now have a side-by-side view of a code window and your design. You can place the data for a contact into the code window. Note that the data must be in JavaScript Object Notation (JSON) format. JSON is a way of structuring data in a collection of key/value pairs. For example, if you use the `first_name` substitution tag, `first_name` is the key and the customer's name is the value. These keys can also be thought of as variables. Like a variable in algebra, these variables represent a value you don't yet know. The following sample customer is provided in JSON format for you to experiment with. ```json { "first_name": "Tira", "last_name": "Misu", "email": "recipient@example.com", "alternate_emails": "recipient+@example.com", "address_line_1": "1234 N. Real Ave.", "address_line_2": "Suite 200", "city": "Denver", "state_province_region": "CO", "postal_code": 80202, "country": "United States", "phone_number": "+15555555555", "Sender_Name": "Orders", "Sender_Email": "orders@example2.com", "Sender_Address": "1234 N. Exist St.", "Sender_City": "Portland", "Sender_State": "OR", "Sender_Zip": 97227, "Sender_Country": "United States" } ``` 4. Once you have test data in place, you should see any substitution tags for which data is present rendered properly. ![A template with the first_name substitution and multiple address substitutions in text fields]({{root_url}}/img/design_editor_substitution_tags.png 'Substitution tags in a template') ![A side-by-side view of the test data and the rendered values in the template]({{root_url}}/img/test_data_replaced.png 'Rendered test data') ### Previewing your email To preview your email or template, click the **Preview** button in the upper-left corner. You can toggle between a mobile and desktop preview mode by clicking either the desktop or mobile phone icons above the content area. To view a plain-text version of your email or template, click the **T** icon. When in this preview mode, you can edit the plain text content of your email or template by clicking the **Edit Plain Text** button. When previewing an email, you also see a preview of the From name, the Subject, and the preheader text that you have selected. ### Editing the HTML Head The HTML `<head>` element is where you can define any metadata you would like to include with your email or template. For example, you can use the `<head>` element to define any custom fonts or CSS styles you would like to use. _To edit the HTML head of your email or template:_ 1. Navigate to the **Build** tab in the left-hand toolbar and scroll to the **Advanced** menu. 1. Expand the option titled **Edit HTML Head**. 1. Click **Edit** to begin editing your HTML head. <br>A window appears where you can insert your custom HTML. 1. Once you've finished making your changes, click the **Update** button. #### Adding custom fonts using the HTML Head Most commonly, users add custom fonts by using the <link> tag to reference a web font hosted somewhere on the internet. For example, [Google Fonts](https://fonts.google.com). <call-out type="warning"> Make sure that you define a web-safe font to use as a fallback if one of your recipient’s clients does not support your custom font. </call-out> While some inbox providers do not support web fonts, the following popular clients do provide web font support\*: - Apple Mail - Outlook.com app - Outlook 2000 - Default Android Mail app (not the Android Gmail app) - iOS Mail \* This list may change and we cannot guarantee 100% support from any of these clients. _To add a custom font using the HTML head:_ 1. Open the HTML Head by navigating to the **Build** tab in the design editor. 1. Scroll down to the **Advanced** drop-down menu and select **Edit HTML Head**. 1. Click **Edit** to begin making your changes. 1. Insert a `<link>` tag containing an href attribute pointing to your web font. ```html <link href="https://fonts.google.com/specimen/Oswald" rel="stylesheet" /> ``` Next, add a `<style>` to specify that you want to use this new font family: ```html <style> body { font-family: 'Oswald', sans-serif; } </style> ``` ### Importing custom HTML with drag and drop markup If you are writing your own custom HTML that you plan on importing into the design editor, refer to the [drag & drop code examples](#drag--drop-code-examples) to ensure that any modules you create are compatible with our drag and drop functionality. If you do not specify a data type that matches one of our drag and drop modules, your code is imported as a text module. _To import custom HTML:_ 1. Navigate to the **Build** tab in the left-hand navigation. 2. Scroll down and select the **Advanced** drop-down menu. 3. Expand the option titled **Import Drag & Drop HTML**. 4. Click **Import**. <br>A window opens where you can paste in your own HTML. ![]({{root_url}}/img/import_custom_html.png 'Import custom HTML') 5. Paste or enter the HTML you want to use and then click **Import**. <call-out type="warning"> Any HTML that you import replaces all existing content in your email or template. If you want to import only a section of HTML, use a [code module](#code-modules). </call-out> ### Drag and drop markup Twilio SendGrid parses your custom HTML, looking for any [drag & drop compatible modules](#drag--drop-code-examples). - First, we look for any HTML elements that contain the attribute `role="modules-container"`. - Next, we look for all HTML elements with the attribute `role="module"` that are descendants of the "modules-container" element. The `role="modules-container"` attribute is required so that we know where your drag and drop modules are located. All of the Twilio SendGrid pre-built templates include the `role="modules-container"` by default. You are only required to include this attribute when creating an email or template from scratch that you want to be compatible with the design editor. <call-out type="warning"> Any HTML outside an element with the "modules-container" attribute is discarded. Only [supported styling options and attributes](#drag--drop-module-descriptions-and-styles) are included. If you don't include the "modules-container" attribute in any of your custom HTML, then all of your HTML is imported as a single text module. </call-out> Following is an example of how you should structure and organize your custom HTML, where `[module content]` represents the content of your modules. ### Drag and drop code examples <code-group langs="Image,Image & Text,text,code,columns,button,divider,spacer,social"> ```image <table class="wrapper" role="module" data-type="image"> <tr> <td [styles go here] align=['left' or 'right']> [MODULE CONTENT] </td> </tr> </table> ``` ```image & text <table role="module" data-type="imagetext"> <tr> <td> <table> <tr role="module-content"> <td class="templateColumnContainer" > <table> <tr> <td class="leftColumnContent" role="column-one"> <table role="module" data-type="image"> <tr> <td role="module-content"> [MODULE CONTENT] </td> </tr> </table> </td> </tr> </table> </td> <td class="templateColumnContainer" > <table> <tr> <td class="rightColumnContent" role="column-two"> <table role="module" data-type="text"> <tr> <td role="module-content"> [MODULE CONTENT] </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> ``` ```text <table class="module" role="module" data-type="text"> <tr> <td [styles go here] bgcolor=[some color]> [MODULE CONTENT] </td> </tr> </table> ``` ```code <table class="module" role="module" data-type="code"> <tr> <td> [MODULE CONTENT] </td> </tr> </table> ``` ```columns <table role="module" data-type="columns"> <tr> <td [styles go here] bgcolor=[some color]> <table> <tr> <td class="templateColumnContainer column-drop-area"> [MODULE CONTENT] </td> <td class="templateColumnContainer column-drop-area"> [ANOTHER MODULE CONTENT] </td> </tr> </table> </td> </tr> </table> ``` ```button <table class="module" role="module" data-type="button"> <tr> <td [styles go here] bgcolor=[some color] align=['left' or 'right']> <table class="wrapper-mobile"> <tr> <td [styles go here too] bgcolor=[some color]> [MODULE CONTENT] </td> </tr> </table> </td> </tr> </table> ``` ```divider <table class="module" role="module" data-type="divider"> <tr> <td [styles go here] bgcolor=[some color]> <table height=[some height]> <tr> <td bgcolor=[some color]></td> </tr> </table> </td> </tr> </table> ``` ```spacer <table class="module" role="module" data-type="spacer"> <tr> <td style="padding: 50px 0 0 0" bgcolor=[some color]> </td> </tr> </table> ``` ```social <table class="module" role="module" data-type="social"> <tbody> <tr> <td [styles go here] data-align=['left', 'right', or 'center']> <table> <tbody> <tr> [MODULE CONTENT] </tr> </tbody> </table> </td> </tr> </tbody> </table> ``` </code-group> ### Exporting HTML from the design editor _To export template HTML from the design editor:_ 1. Navigate to the **Build** tab in the left-hand navigation. 1. Scroll down and select the **Advanced** drop-down menu. 1. Expand the option titled **Import/Export**. <br>This starts the raw HTML download of the template, excluding images. SendGrid hosts the images included in the pre-built templates and any images you have uploaded to the image library, so when you export a template’s HTML from the design editor, the embedded URLs in each `<img>` tag remains valid. _To open exported HTML in the code editor using Single Sends:_ 1. From the left-hand navigation, select **Marketing** and then click **Single Sends**. 1. Click **New Campaign** and then select **Blank Template**. 1. Select **Code Editor**. 1. Paste the raw SendGrid template HTML into the code editor. _To open exported HTML in the code editor using Automations:_ 1. From the left-hand navigation, select **Marketing** and then click **Automations**. 1. Click **Create an Automation** and then navigate to _Custom Automation_ and click **Select**. 1. Navigate to the first email in the Automation series and click **Edit Email Content**. 1. Locate the blank template and click **Select**. 1. Select **Code Editor**. 1. Paste the raw SendGrid template HTML into the code editor. ### Adding Categories with the Design Editor <call-out type="warning"> Category information will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> _To add a category:_ 1. Navigate to the **Settings** tab and click **Single Send Settings** to expand the menu. 1. Find the **Categories** field. 1. Enter the name of a new category or select a previously used category from the drop-down menu. ## Additional resources - [Sending an Email]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [A/B Testing]({{root_url}}/ui/sending-email/a-b-testing/) - [Campaign Statistics]({{root_url}}/ui/analytics-and-reporting/marketing-campaigns-stats/) - [Marketing Templates]({{root_url}}/ui/sending-email/working-with-marketing-templates/) ================================================ FILE: content/docs/ui/sending-email/email-flow.md ================================================ --- layout: page weight: 0 title: Email Flow group: delivery-optimization navigation: show: true seo: title: Email Message Flow Explained description: A basic diagram and description of how each email message flows in general and through SendGrid keywords: Email flowchart, email delivery flow, email delivery diagram, basic email flow --- SendGrid has helped thousands of customers send their email messages since 2009. We help our customers build their email content, send their messages, and view the success of each campaign sent. We also realize that the actual journey of an email message sent to an inbox is complicated. Sometimes this process may not be fully understood by all senders. This post shows the basics of the email path, along with where SendGrid is helping to make that journey less complicated. In the email flowchart below, you can see the main components that all email messages pass through. Granted, there are many other finer details involved within each step, but for the sake of this post, we’re keeping it to the basics. ![]({{root_url}}/img/MailFlow.png "Email Flow") First, a sender puts together the content that their recipients will love. Then it’s time for the “SMTP conversation” to take place. SMTP stands for Simple Mail Transfer Protocol, and this conversation is what makes email messages get from the sender to the recipient. It’s easiest to think of an SMTP conversation as a “handshake”. Imagine that a sender is a host at a party and all of the other guests are the recipients of the message. The host will shake every guest’s hand and during that “handshake” they will have this SMTP conversation. In the end, the guest (i.e. recipient and its recipient server) will determine if they will accept the message or not. In this scenario, you can think of SendGrid as a person at the party grabbing both the host’s and guest’s hands and making the handshake and discussion actually happen. ## The “Handshake” Details and Results The sender connects to the SMTP server through SendGrid and tells the server the final destination it would like its message to go to. Let’s say it is “person@example.com”. The SMTP server recognizes the domain portion (the part after the @ sign) of “example.com” and contacts the receiving server responsible for accepting messages for that domain. During this connection, the two servers exchange multiple pieces of information. The receiving server typically then says one of the following: * “Yes, I know who ‘person’ is and all is in order to deliver it to their inbox.” * “Yes, I know who ‘person’ is and all is in order to deliver the message, but not to the inbox.” * “Yes, I know who ‘person’ is and there are still some items I have to identify, so I am not going to deliver the message at this time but I am not sending it back to the sender.” (aka a deferred message) * “No, I do not know who ‘person’ is and will be sending the message back to the sender.” (aka a bounced message) ## Determining Factors of Delivery As mentioned before, there are many pieces of information exchanged between the sending and receiving mail servers. As you can see from the email flow diagram, the other 2 places SendGrid assists in the message path (along with the Outbound Mail Server) are the DNS (Domain Name System) and Authentication portions. The receiving server wants to trust the mail that is being exchanged in order to accept it. DNS and Authentication assists with this decision. ### DNS DNS stands for “Domain Name System” and it is thought of as the “phone book for the Internet”. It houses many pieces of information for the sending domain of a message. The receiving server checks this “phone book” to see if it can determine who the sender is and if they are trusted. ### Authentication The receiving server will check: * if there is an SPF (Sender Policy Framework) record in place (to see if the mail is coming from an IP authorized by that domain's administrators); * if there is a DKIM (DomainKeys Identified Mail) record in place (to see if the message was tampered with in transit by someone other than the sender); * if there is a DMARC (Domain-based Mail Authentication Reporting and Conformance) record in place (this tells the receiving server where to place the mail based on the results of the SPF and DKIM authentication). SendGrid’s sender authentication feature assists with setting up both SPF and DKIM properly. This assists the host (sender) in being more recognizable and the guest (recipient) and their mailbox provider to more easily trust the content attempting to be shared during the conversation. ### Reputation When reviewing the sending IP and domain, the receiving server will factor in both of the following items: * The reaction of its other recipients to mail sent by that same IP and domain (i.e. whether or not marked as spam). * Where the receiving server previously decided to place any mail from the same IP and domain. <call-out> The reputation of the domains included in the links within the body content will also factor into delivery. </call-out> ### User Level Filtering Along with these items listed above, some recipients may also have their own individual rules within their inbox of where certain mail will go. This placement is harder to change, aside from making sure that your content is desired by the recipient and they won’t be creating any custom filters to have your messages delivered anywhere but the inbox. ## Reacting to Opinions of the “Guests” ### Feedback for the Guests to Give the Host Within an email, there is a function known as a Feedback Loop. Feedback Loops are created by the mailbox providers and a sender can get set up to receive notifications through them to inform them when a recipient complains about the sender’s message (aka marking a message as junk or spam). This should help the host (sender) to be aware of when certain guests didn’t want the content included in their interaction. The host (sender) should not try to have another conversation with (aka send messages to) these guests in the future. <call-out> Get additional onboarding support. Save time, increase the quality of your sending, and feel confident you are set up for long-term success with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ================================================ FILE: content/docs/ui/sending-email/email-testing.md ================================================ --- layout: page weight: 70 title: Email Testing group: marketing-campaigns navigation: show: true seo: title: Email testing keywords: email testing, send test email, email rendering test override: true Description: How to use SendGrid's new email testing feature to preview how your email renders, performs against spam filters, and validate the links within your email. --- <iframe src="https://player.vimeo.com/video/389535005" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> Email testing offers robust, pre-send testing of your emails, including in-app spam testing, inbox rendering previews, and link validation without leaving your workflow. It allows you to preview how an email is likely to perform across a wide range of inbox providers, devices, and spam filters, before sending. - **Inbox Rendering Test:** Displays how an email message is rendered and appears across a select group of inbox providers and devices. - **Spam Test:** Shows how an email performs against the world’s most powerful consumer (B2C) and enterprise (B2B) spam filters. - **Link Validation Test:** Tests all links within a message to ensure they are valid. The test checks for redirects, domain reputation, and critical metadata, like title text. Your inbox rendering tests will automatically include this link validation test. Link validation tests **do not** deduct from your Email Testing credits. <iframe src="https://player.vimeo.com/video/359828434" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> ## Email Testing credits and pricing The number of Email Testing credits available to you depends on your Marketing Campaigns or Email API plan. For more information on email plans, see our [pricing page](https://sendgrid.com/pricing/). Email Testing credits can be used for both Inbox Rendering Tests and Spam Tests, and all Email Testing credits (whether part of your plan or purchased as part of an add-on package) expire at the end of each month. ## Purchasing additional credits If you find yourself in need of more credits than your email plan offers, we offer additional Email Testing credit packages as add-ons to your monthly plan. <callout> Packages for additional Email Testing credits are billed on a monthly, recurring basis and will continue to renew each month unless removed from your account. </callout> Available Email Testing credit add-on packages are: <ul> <li><strong>30 Email Testing Credits</strong> per month, available for $18.00 USD</li> <li><strong>60 Email Testing Credits</strong> per month, available for $30.00 USD</li> <li><strong>100 Email Testing Credits</strong> per month, available for $40.00 USD</li> </ul> ## Running an Email Test Email testing is available for both Marketing Campaigns and emails within API plans ultilizing Dynamic Templates. *To test an email:* 1. From inside either the Design or Code editor, navigate to the Settings tab. 1. Scroll down and click on the **Test Your Email** dropdown to expand testing options. 1. Below the option to send a test email, you will see an **Email Testing** option. To create a test, click **Create Test**. <call-out> Before you can create a test, you need to specify a Sender and include a Subject for your email. </call-out> ![]({{root_url}}/img/auto-email-testing-launch.png "Launch Automated Email Testing") 4. When Email Testing opens a new test, choose which kind of tests you'd like to run by selecting the checkboxes next to **Spam Test**, **Inbox Rendering Test**, or by selecting both. <call-out> Every inbox rendering test that you run automatically includes a link validation test, checking that all URLs within your message are valid. Link validation tests **do not** deduct from your Email Testing credits. </call-out> 5. If you choose to run an Inbox Rendering test, select the clients and browsers you'd like to include as part of your test by clicking the associated checkbox for each. 6. Click **Run Test**. 7. Your test will begin. Please note: It may take a moment for the test to begin returning your results. Test results will appear on the **View Test Results** tab. Click any thumbnail of a rendering to open the image and view in greater detail. 8. From the View Test Results tab, you can select the **Inbox**, **Spam**, or **Links** tabs to view all of the details for your test. ## Additional Resources - [A/B Testing]({{root_url}}/ui/sending-email/a-b-testing/) - [Design Editor]({{root_url}}/ui/sending-email/editor/#-The-Design-Editor) - [Code Editor]({{root_url}}/ui/sending-email/editor/#the-code-editor) - [Dynamic Templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) ================================================ FILE: content/docs/ui/sending-email/email-to-sms.md ================================================ --- seo: title: Email to SMS description: Email to SMS keywords: sms, short, service, carrier, media, gateway, 5724, provider, vtext, message, text, att, tmobile, verizon title: Email to SMS group: delivery-optimization weight: 0 layout: page zendesk_id: 202603863 navigation: show: true --- SendGrid occasionally gets the question "Why isn't my email to SMS working?" Basically, SMTP-to-SMS gateways have narrow bandwidth, due to the need for mobile carriers to predict network traffic, as well as a way to prevent spam to their users. Furthermore, mobile carriers are not incentivized to successfully deliver SMTP-to-SMS messages, since they often provide this as a free service. Senders will see deferrals and blocks if they attempt to send high volumes without reaching a payment agreement with mobile carriers ahead of time. Here’s a relevant comment about SMS from [RFC 5724](http://www.ietf.org/rfc/rfc5724.txt): > "SMS messages very often are delivered almost instantaneously (if the receiving SMS client is online), but there is no guarantee for when SMS messages will be delivered. In particular, SMS messages between different network operators sometimes take a long time to be delivered (hours or even days) or are not delivered at all, so applications SHOULD NOT make any assumptions about the reliability and performance of SMS message transmission." Essentially, email to SMS may work for occasional messages at low volume, and even then it can be a gamble. ================================================ FILE: content/docs/ui/sending-email/formatting-html.md ================================================ --- seo: title: HTML Formatting Issues description: HTML Formatting Issues keywords: message, format, html title: HTML Formatting Issues group: building-email weight: 0 layout: page navigation: show: true --- To be successful sending email through SendGrid and to ensure that your content gets preserved as needed, please follow these guidelines. These guidelines are also useful if you are encountering issues with the HTML formatting or styling of your messages. **Duplicate Versions** Ensure your email contains both Plaintext and HTML versions so recipients can view the information within the mail client of their choice. If you only send HTML emails and a recipient's server or mail client blocks HTML content, they will not see anything in your emails. **Character Limits** Make sure that each line of content does not exceed 78 characters in length, nor that you exceed 998 continuous characters. For more information on how email should be formatted, see these [Formatting Guidelines](http://tools.ietf.org/html/rfc5322). (Refer to 2.1.1. Line Length Limits.) **Troubleshooting** Some mailers, such as Apple Mail, place Multipurpose Internet Mail Extensions (MIME) into emails automatically which can cause our system to not parse the boundaries correctly. If you do notice a problem with the content from your email not rendering correctly, please do the following: 1. Some mail clients, such as Outlook and Thunderbird, appear to insert double spacing line breaks at every line. The reason is that the 'content-transfer-encoding' in MIME is set to 'quoted-printable' which adds Carriage Return Line Feed (CRLF) line breaks to the source content of the email which are characters interpreted by these mail clients. To alleviate this problem, please do the following: a) If you can customize the MIME settings for your email, set the 'Content-Transfer-Encoding' to '7bit' instead of 'Quoted-Printable.' b) Ensure that your content follows the [line length limits](http://tools.ietf.org/html/rfc5322). 2. Hard line breaks appear as CRLF characters in the source of an email with the character combination of " **=0D**" in the source of an email. This only happens with 'quoted-printable' (Content-Transfer-Encoding set in MIME) emails. Email clients such as Outlook and Thunderbird render these characters which results in additional breaks in the content of your emails. 3. The best possible MIME layout in your email when sending through SendGrid is as follows. It is best to reference files using separate links to download since it lowers the percentage of spam threshold for most domains you are sending to. ================================================ FILE: content/docs/ui/sending-email/getting-started-with-automation.md ================================================ --- layout: page weight: 0 group: marketing-campaigns title: Getting Started with Automation order: 2 seo: title: Getting Started with Automation description: Use Automation to create an automated email series or drip campaign targeted towards a specific audience. keywords: automation, triggered email, automated email, welcome series navigation: show: true --- <iframe src="https://player.vimeo.com/video/382215903" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> <call-out> Automation is available as part of the Advanced Marketing Campaigns package. To access this feature, please upgrade to Advanced Marketing Campaigns from [Your Products](https://app.sendgrid.com/account/billing/choose_plan_marketing_campaigns). </call-out> Automation allows you to send a recurring email or drip series to contacts automatically at a cadence you define. Once you create an Automation, you can trigger them to send automatically by adding new recipients to a chosen list or segment, saving you time. With Automation, you could build email campaigns to: - Welcome new contacts when they join your list with a warm message and introductory tips. - Engage contacts who’ve downloaded an asset from you with follow-up content. - Promote an upcoming event to a list of invitees with a series of reasons to attend. <iframe src="https://player.vimeo.com/video/396803246" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> ## Getting Started with Automation If you haven’t done so already, you’ll need to complete the following before building your first automation: - Add a [notification]({{root_url}}/ui/account-and-settings/notifications/) email - Create [Unsubscribe Groups]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/) - Add a [sender]({{root_url}}/ui/sending-email/senders/) (optional) ## Create an Automation Once you've completed the prerequisites, you’re ready to start building your first automation. You can start with a pre-built Welcome Series and make it your own, or start from scratch by selecting **Custom Automation**. <call-out> ​ Click tracking was released on 7/16/20. To enable click tracking for automations set live prior to 7/16, pause the automation and set it to live once again. Click tracking will populate data from 7/16/2020 onward regardless of when it is set live. </call-out> ### Create a Custom Automation _To create a Custom Automation:_ 1. Navigate to **Automations** and then click **Create an Automation**. 1. Under Custom, click **Select**. 1. Give the series a name. This is for your reference and will not be visible to your contacts. 1. Select the entry criteria. You can choose from "The first time a [contact is added to a list]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/#add-contacts) or "The first time a contact is added to a [segment]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/)". <call-out> Contacts will only receive your automation if they are added to the list or segment you select for entry criteria _after_ you set the automation live. </call-out> 5. Select the exit criteria for this series. You can choose from "Contacts have received all emails in the automation" or "Contacts no longer meet the entry criteria". <call-out> If you select “no longer meet entry criteria”, before each email in your series sends, Marketing Campaigns will check to make sure each recipient is still on the entry criteria list or segment. If they aren’t, they won’t get the email. For more information on deleting contacts or removing them from lists, see [Create and Manage Contacts]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#edit-or-remove-contacts-from-a-list). </call-out> 6. Select an [Unsubscribe Group]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/#create-an-unsubscribe-group). This Unsubscribe Group will apply to all emails in your Automation. 7. Add a [category]({{root_url}}/glossary/categories/) to the automation (optional). Categories are useful for [comparing performance]({{root_url}}/ui/analytics-and-reporting/category-comparison/) across different types of email you send. <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> <call-out> If you have dedicated IPs, you can set up [IP Pools]({{root_url}}/ui/account-and-settings/ip-pools/) that allow you separate your traffic and potentially enhance your deliverability by protecting your sender reputation. To utilize IP pools for Automations, select the IP Pool you wish to use for the entire automation series from the IP Pool drop-down. </call-out> 8. Select the send time for the first email. You can choose to send the first email instantly, or you can set a delay of days or hours from the time meet the entry criteria. 9. Build your email(s) by clicking **Add Email Content**. 10. Choose a template, then use your preferred [editor]({{root_url}}/ui/sending-email/editor/) to craft your content. 11. If you did not do so within the editor, you can add a subject line and select a sender from the Edit Automation page. 12. To add more emails to this automated series, click **Add an Email**. 13. Choose how long to wait before sending the next email. This time will be relative to the preceding email. 14. Once you have created all of your emails for the automation, click **Set Live**. ### Use the Pre-Built Welcome Series The pre-built Welcome Series automation provides a jumping off point to inspire you to create your own tailored welcome series. _To create a Welcome Series:_ 1. Navigate to **Automations** and then click **Create an Automation**. 2. Under Welcome, click **Select**. 3. Update the automation name (this is for your reference and will not be visible to your contacts). 4. Review the entry criteria to decide if you’d like to update it. The default entry criteria is “The first time a contact is added to All Contacts”. 5. Review the exit criteria to decide if you’d like to update it. 6. Select an [Unsubscribe Group]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/#create-an-unsubscribe-group). This Unsubscribe Group will apply to all emails in your Automation. 7. Add a [category]({{root_url}}/glossary/categories/) to the automation (optional). Categories are useful for [comparing performance]({{root_url}}/ui/analytics-and-reporting/category-comparison/) across different types of email you send. <call-out type="warning"> Categories will be stored as a “Not PII” field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you’ve left SendGrid’s platform. </call-out> 8. The pre-built Welcome Series has three placeholder emails by default. You’ll need to edit the subject line and content of each email. You may decide to remove or add emails to the pre-built. 9. If you did not do so within the editor, you can add a subject line and select a sender from the Edit Automation page. 10. To add more emails to this automated series, click **Add an Email**. 11. Choose how long to wait between each email in the series. This time will be relative to the preceding email. 12. Once you have created all of your emails for the automation, click **Set Live**. <call-out type="warning"> If you keep the entry criteria as "All Contacts" it's important to remember that any recipient you add to your Automation contacts after you set the welcome series live will be entered into the automation. Use "All Contacts" with caution to avoid sending a welcome series to contacts that aren't actually new to you. </call-out> ## Manage Automations ### Duplicate an Automation _To duplicate an automation:_ 1. Navigate to Automations. 1. Find the automation you want to duplicate. 1. Select the Action Menu to the right of the automation. 1. Click **Duplicate**. 1. Once you create the duplicate, the automation will open to the edit page. From here, you can change any or all of the settings within the automation. ### Edit an Automation You can edit the content, subject line, and sender for any emails in your automation. _To edit an automation:_ 1. Navigate to **Automations** and select the series you want to edit. 1. Click **Edit** on each email you’d like to modify. <call-out> You can also create a template from an existing email within your Automation series by selecting the action menu next to the email you'd like to reuse and selecting **Create Template**. </call-out> 3. Make your changes in the editor, then click **Save**. 4. Click the arrow in the upper left-hand corner. 5. Below the email you’ve edited, you’ll see an alert that changes have not yet been applied to the live automation. When you’re ready to apply them, click **Save and Apply**. ### Disable an Automation _To disable an automation:_ When you disable an automation, all emails in your automation will stop sending unless you set it live again. No new contacts will be entered into your automation while it's disabled. If you set the automation live again, contacts who entered the automation before it was disabled will continue receiving emails again according to where they left off. 1. Navigate to **Automations** and select the series you want to stop. 1. Select the Action Menu to the right of the Automation. 1. Click **Disable Automation** in the upper right corner. _To set a disabled automation live again:_ 1. Navigate to **Automations** and select the series you want to re-enable. 1. Select the Action Menu to the right of the Automation. 1. Click **Set Live** in the upper right corner. <call-out> When you re-enable the automation, contacts who previously entered the series will continue receiving emails where they left off in the series. Contacts who met your entry criteria during the disabled period will not be added to the automation. For this reason, do not add users to lists that are used as the entry criteria for automations in a disabled state. </call-out> ## Automation Use Cases and Examples ### Segment-triggered nurture series A valuable use case for Automation is to nurture your free customers to become paid using a drip series. The series will send automatically to free users until they reach the end of the email sequence or they upgrade to paid, whichever comes first. Here's how: 1. Create a segment of all contacts whose custom field “Plan Type” value is “Free” 1. Set entry criteria to the first time a contact "is added to a segment" and select the “Free customers" segment you just created. 1. Set the exit criteria as “Contacts no longer meet entry criteria” 1. Craft a series of emails to nurture contacts to become paid. From there, any time you add a new contact whose plan type is "Free", they are automatically added to the relevant segment and entered into the automation. If they upgrade their plan during the drip series, Automation automatically removes them from the series. ================================================ FILE: content/docs/ui/sending-email/global-unsubscribes.md ================================================ --- layout: page weight: 0 title: Global Unsubscribes group: tracking seo: title: Global Unsubscribes description: Recipients can unsubscribe from everything you send, rather than just a single group. keywords: Global suppressions, global unsubscribes, global email unsubscribe, global email suppression navigation: show: true --- Global unsubscribes happen when a recipient indicates that they would like to opt out from any email that you send by clicking on the [Unsubscribe From All Emails link](#global-unsubscribe-substitution-tags) within your emails. The list provided here can be filtered by email address or date. ## Searching Global Unsubscribes by Date In the top right corner, you will see a calendar icon. Click this and choose the unsubscribe dates you would like to search between. Your recipient list will refresh, showing the recipients who unsubscribed between these dates. ## Removing Recipients From The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. ## Download Global Unsubscribes as CSV _To download your Global Unsubscribe list as a CSV:_ 1. Navigate to the Global Unsubscribes page. 1. Click the action menu at the top of the page. 1. Select **Download as CSV**. The file will download in your browser right away. ### Global Unsubscribe Substitution Tag When you add the `<%asm_global_unsubscribe_url%>` tag to your email, we will replace that tag with the text "Unsubscribe From All Emails", wherever the tag is found in your email. This will allow your recipient to be globally unsubscribed from all of your emails. Alternatively, you can use the `<%asm_global_unsubscribe_raw_url%>` tag, which will be replaced with only the global unsubscribe URL without the hyperlinked text "Unsubscribe From All Emails". <call-out> When using our ASM Global or Group Unsubscribe tags, you must pass an unsubscribe group in your API or X-SMTPAPI request for the unsubscribe link to populate. </call-out> ## Using the API You can manage your Global Unsubscribes via the [Global Suppressions API](https://sendgrid.api-docs.io/v3.0/suppressions-global-suppressions). ## Additional Resources - [Global unsubscribes vs. Group Unsubscribes]({{root_url}}/ui/sending-email/subscription-tracking/) - [Group Unsubscribes]({{root_url}}/ui/sending-email/group-unsubscribes/) - [Invalid Emails]({{root_url}}/ui/sending-email/index-suppressions/) ================================================ FILE: content/docs/ui/sending-email/google-feedback-loop.md ================================================ --- seo: title: Google Feedback Loop (Spam Complaints) description: Google Feedback Loop (Spam Complaints) keywords: title: Google Feedback Loop (Spam Complaints) group: delivery-optimization weight: 0 layout: page zendesk_id: 202604713 navigation: show: true --- SendGrid does automatically suppress any spam complaint address reported through traditional feedback loops. However, some webmail providers, notably Gmail, do not provide a traditional feedback loop out of privacy concerns. Rather, they provide an anonymous, aggregate report directly to us about concerning senders. This matters to you because senders with high spam complaints will often see their mail broadly throttled or blocked during future email campaigns if this remains an unresolved issue. Since Gmail’s reporting is anonymous, you won’t know specifically who flagged your mail as spam, and you likely won’t know this is an issue until SendGrid reaches out to you. If you receive a report from us about Google spam complaints, or even from traditional feedback loops, we have a few best practices to help you resolve the issue: 1. If you don’t have opt-in, don’t send any more to those lists. It’s against our [Terms of Service](https://sendgrid.com/policies/email/), and considered to be [spam](https://www.spamhaus.org/consumer/definition/) anyway by the email community. 2. If your list is opt-in, track who’s actually engaging with your email, as measured by click and open tracking. Many customers have this data in their own CRM, or you may prefer to use our own Click and Open Tracking apps, coupled with the [Event Webhook]({{root_url}}/for-developers/tracking-events/getting-started-event-webhook/) to consume this data. For recipients who don’t engage with your email, after a certain period of time that you determine to be appropriate based on your customer base and business model, stop sending to them. This tends to be a period between a few weeks and 3 months, depending on your sending frequency. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> If you receive a report from us about spam complaints, use this as an opportunity to implement better list acquisition and maintenance. <call-out> Looking for customized expert advice to improve your email program? Our team of email experts can help you create a plan to ensure you're optimizing your email delivery and engagement, and avoiding future issues. Learn more on our [Expert Services](https://sendgrid.com/solutions/expert-services/?utm_source=docs) page. </call-out> ================================================ FILE: content/docs/ui/sending-email/group-unsubscribes.md ================================================ --- layout: page weight: 0 title: Group Unsubscribes group: tracking seo: title: Group Unsubscribes description: Allow recipients to unsubscribe from specific types of email you send, rather than everything you send, and stay out of the spam folder. keywords: Group suppressions, Group unsubscribes, Group email unsubscribe, Group email suppression navigation: show: true --- A group unsubscribe happens when a recipient indicates that they would like to opt out from a specific type of email that you send via the [Unsubscribe Groups link](#group-unsubscribe-substitution-tag) from within your email. The list provided here can be filtered by email address or date. ## Searching Group Unsubscribes by Date In the top right corner, you will see a calendar icon. Click this and choose the unsubscribe dates you would like to search between. Your recipient list will refresh, showing the recipients who unsubscribed between these dates. ## Download Group Unsubscribes as CSV *To download your Group Unsubscribe list as a CSV:* 1. Navigate to the Unsubscribe Groups page and locate the list you want to download. 1. Click the action menu next to the list. 1. Select **Export**. The file will download in your browser right away. ## Removing Recipients From The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. ### Group Unsubscribe Substitution Tag When you add the `<%asm_group_unsubscribe_url%>` tag to your email, we will replace that tag with the text "Unsubscribe From This List", wherever the tag is found in your email. This link will allow your recipients to unsubscribe from the unsubscribe group that you attached to this email. Alternatively, you can use the `<%asm_group_unsubscribe_raw_url%>` tag which will be replaced with only the group unsubscribe URL without the hyperlinked text "Unsubscribe From This List". <call-out> When using our ASM Global or Group Unsubscribe tags, you must pass an unsubscribe group in your API or X-SMTPAPI request for the unsubscribe link to populate. </call-out> ## Using the API You can manage your Global Unsubscribes via the [Group Suppressions API](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups/retrieve-all-suppression-groups-associated-with-the-user). ## Additional Resources - [Global unsubscribes vs. Group Unsubscribes]({{root_url}}/ui/sending-email/index-suppressions/#suppressions-vs-unsubscribes) - [Global Unsubscribes]({{root_url}}/ui/sending-email/global-unsubscribes/) - [Invalid Emails]({{root_url}}/ui/sending-email/invalid-emails/) ================================================ FILE: content/docs/ui/sending-email/how-to-implement-dmarc.md ================================================ --- seo: title: How to Implement DMARC description: How to Implement DMARC keywords: security, secure, dmarc, spf, dkim, sender verification, wizard, rua, reject, quarantine title: How to Implement DMARC group: delivery-optimization weight: 0 layout: page navigation: show: true --- Domain-based Message Authentication, Reporting and Conformance (DMARC) was created to tell a participating receiving email server what to do with a message that fails both [SPF]({{root_url}}/glossary/spf/) and [DKIM]({{root_url}}/glossary/dkim/) validation. In other words, what to do if a message claims to be from you, but isn't. If SPF, DKIM, and email validation are new concepts to you, see [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) for a full explanation. ## Why you should deploy DMARC Deploying DMARC for your email systems is a powerful way to help prevent malicious entities from potentially spoofing or otherwise tarnishing your reputation as a trustworthy email sender. DMARC isn't for everyone. If you own a small domain, you're probably OK without it. If you have ever had problems with phishing, or if you operate a finance-related business, implementing DMARC may be a good decision. DMARC, in conjunction with a dedicated IP (included in Pro or higher accounts), is a great start to getting industry-supported peace of mind. <call-out> Twilio SendGrid now offers additional DMARC enforcement and monitoring options in partership with [Valimail](https://go.valimail.com/TwilioSendGrid.html). Click [here](https://sendgrid.com/blog/twilio-launches-partnership-with-valimail-dmarc-solutions-to-deploy-sophisticated-anti-phishing-technologies-at-scale/) for more information. </call-out> ## Reading DMARC reports The DMARC aggregate and forensic reports are designed to be machine readable and can be difficult for humans to make sense of. You will also need to utilize a DMARC report monitoring service to collect the reports and present the information in a meaningful way that leads to actionable insights. [Return Path's Email Brand Monitor](https://www.validity.com/products/returnpath/) is one, and [Agari](https://www.agari.com/dmarc/) is another. <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## The 5 phases of implementation: 1. Deploy DKIM & SPF by setting up reverse DNS for your SendGrid IP. 2. Ensure proper DKIM and SPF signing for your authenticated domain. 3. Publish a DMARC record with your DNS registrar, then monitor the results. 4. Analyze the feedback you receive, and adjust your mail streams as needed. 5. Escalate your DMARC policy tags from `p=none` to `p=quarantine` to `p=reject` as you gain experience. ### 1. Deploy DKIM and SPF by setting up reverse DNS for your SendGrid IP Start by setting up reverse DNS for your account. This ensures that emails sent through your SendGrid account will be properly signed using DKIM and SPF for your unique domain. For more information on completing this process, see [How to set up reverse DNS]({{root_url}}/ui/account-and-settings/how-to-set-up-reverse-dns/). ### 2. Ensure proper DKIM and SPF signing for your authenticated domain Send yourself some test emails if you're unsure of this step. You're looking to verify that the DKIM and SPF signatures in your email headers align to the domain you've authenticated your SendGrid account with. #### Examples of a passing DKIM and SPF check ![A passing SPF and DKIM check summary from the Twilio domain]({{root_url}}/img/dkim_spf_pass_1.png) ![A passing SPF and DKIM check in the headers of an email from the Twilio domain]({{root_url}}/img/dkim_spf_pass_2.png) As long as both DKIM and SPF are passing, you’re in business! ### 3. Publish a DMARC record with your DNS registrar, then monitor the results Within your DNS registrar, you'll need to create a TXT resource record that receivers can use to determine your DMARC preferences. This is done within the DNS registrar of the domain host—likely the same place you created the DNS records for the authenticated domain. This record is made at the root level for the domain, not the subdomain. #### A simple DMARC record "v=DMARC1; p=none; pct=100; rua=mailto:dmarc.rua@customdomain.com" For details about DMARC records, see the [DMARC Records]({{root_url}}/ui/sending-email/dmarc/#dmarc-records) section of [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) where you'll find detailed explanations of every tag in a DMARC record. <call-out> Always start out using the `p=none` policy. You can move to `p=quarantine` or `p=reject` when you better understand your sending reputation. </call-out> ### 4. Analyze the feedback you receive and adjust your mail streams as needed If unqualified mail gets sent to, and received by, recipients participating in DMARC, the recipient will generate reports for these messages and send them back to the `mailto:` address specified in your DMARC record. These reports will give you the information required to evaluate and tune your mail streams, helping you determine exactly what services are sending mail on behalf of your domain. Below is a sample report with only one record, showing the results for 2 pieces of mail. Please note that the listed SPF and DKIM `auth_results` are raw results, regardless of the `s=` alignment. For help understanding all the tags in a DMARC record, see the [DMARC Records]({{root_url}}/ui/sending-email/dmarc/#dmarc-records) section of [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/). <call-out> The filename is formatted as: filename = receiver "!" policy-domain "!" begin-timestamp "!" end-timestamp "." extension Example: receiver.org!sender.com!1335571200!1335657599.zip </call-out> #### Sample DMARC report <?xml version="1.0" encoding="UTF-8" ?> <feedback> <report_metadata> <org_name>receiver.com</org_name> <email>noreply-dmarc-support@receiver.com</email> <extra_contact_info>http://receiver.com/dmarc/support</extra_contact_info> <report_id>9391651994964116463</report_id> <date_range> <begin>1335571200</begin> <end>1335657599</end> </date_range> </report_metadata> <policy_published> <domain>sender.com</domain> <adkim>r</adkim> <aspf>r</aspf> <p>none</p> <sp>none</sp> <pct>100</pct> </policy_published> <record> <row> <source_ip>72.150.241.94</source_ip> <count>2</count> <policy_evaluated> <disposition>none</disposition> <dkim>fail</dkim> <spf>pass</spf> </policy_evaluated> </row> <identifiers> <header_from>sender.com</header_from> </identifiers> <auth_results> <dkim> <domain>sender.com</domain> <result>fail</result> <human_result></human_result> </dkim> <dkim> <domain>sender.net</domain> <result>pass</result> <human_result></human_result> </dkim> <spf> <domain>sender.com</domain> <result>pass</result> </spf> </auth_results> </record> </feedback> <call-out> Aggregate reports are sent as a ZIP attachment, so be sure the address you’re defining is able to accept attachments in this file type. </call-out> ### 5. Escalate your DMARC policy tags from `p=none` to `p=quarantine` to `p=reject` as you gain experience Now that you’ve tested and tweaked your mail streams to determine exactly who and what is sending mail for your domain, you can adjust your policy setting. Until now you should have been using the `p=none` policy to get reports of any errant behavior, and you should have a good idea of where email is coming from. The next step is to adjust the policy on your DMARC record to start controlling how receivers handle email claiming to be from your domain. **p=none** - Get reports of infractions, but no action is taken by recipients as far as processing the messages themselves. **p=quarantine** - Unqualified mail goes directly to spam, but can be recovered. This is useful when you’re fairly certain you know all the locations where mail is coming from but want to "softfail" any messages that are unqualified until you’re 100% sure. **p=reject** - Unqualified mail is completely deleted by the recipient mail server, never to be seen again. Use this setting when you’re absolutely sure you know every server and service that is sending email for your domain, signing is in place for each of these services, and you want any service claiming otherwise to be completely denied <call-out> Get started on the right foot. Be confident that your account is optimized and set up for success now and as your email program continues to grow with [SendGrid Onboarding Services](https://sendgrid.com/marketing/onboarding-services-request/?utm_source=docs). </call-out> ## Additional Resources - [Everything about DMARC]({{root_url}}/ui/sending-email/dmarc/) - [DMARC.org](https://dmarc.org/) - [DMARC.org Frequently Asked Questions](https://dmarc.org/wiki/FAQ) - [DMARC specification](https://dmarc.org/resources/specification/) - [Returnpath quickstart download](https://returnpath.com/downloads/authenticating-email-dmarc-spf-dkim-quick-start-guide/) - [Agari](https://www.agari.com/dmarc/) - [SPF record validator](https://www.kitterman.com/spf/validate.html) - [DMARC record validator](https://kitterman.com/dmarc/assistant.html) ================================================ FILE: content/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates.md ================================================ --- layout: page weight: 100 title: How to send an email with Dynamic Transactional Templates group: transactional-email navigation: show: false seo: title: How to send an email with Dynamic Transactional Templates override: true description: --- ## Before you begin Before you create and send an email using a dynamic transactional template you need to do the following: - Create a SendGrid account - Create an [API Key]({{root_url}}/ui/account-and-settings/api-keys/) - Add an [unsubscribe group]({{root_url}}/ui/sending-email/group-unsubscribes/) (optional) ## Design a dynamic transactional template 1. Open the [Dynamic Transactional Templates](https://sendgrid.com/dynamic_templates) page and click **Create Template**. 2. Add a unique template name and then click **Save**. 3. To begin editing your new template, click **Add Version**. 4. Select an editor and click **Continue**. 5. Design your template. For more information on using Handlebars, see [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/). ## Unsubscribe modules for dynamic transactional templates If you want to create a static unsubscribe module for a dynamic transactional template, you can copy the contents of an unsubscribe module into a text module and then replace the sender name and address substitution tags with the desired information or handlebars syntax as shown below. For sample templates that include examples of receipts, password resets, account activations, newsletters, and sale notifications, check out the [dynamic-template section of our email template's GitHub repo](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates). The cURL calls on this page use the [receipt example template](https://github.com/sendgrid/email-templates/tree/master/dynamic-templates/receipt). <call-out type="warning"> To send mail using Dynamic Templates, you must use the [Web API mail.send](https://sendgrid.com/docs/for-developers/sending-email/v3-mail-send-faq/). SMTP sends do not support Dynamic Templates. </call-out> ## Send a transactional email _To send a dynamic transactional email:_ In order to send a dynamic transactional email using cURL, set your call up to look something like this: ``` curl -X "POST" "https://api.sendgrid.com/v3/mail/send" \ -H 'Authorization: Bearer <<YOUR_API_KEY>>' \ -H 'Content-Type: application/json' \ -d '{ "from":{ "email":"example@.sendgrid.net" }, "personalizations":[ { "to":[ { "email":"example@sendgrid.net" } ], "dynamic_template_data":{ "total":"$ 239.85", "items":[ { "text":"New Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png", "price":"$ 79.95" }, { "text":"Old Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/3629f54390ead663d4eb7c53702e492de63299d7c5f7239efdc693b09b9b28c82c924225dcd8dcb65732d5ca7b7b753c5f17e056405bbd4596e4e63a96ae5018.png", "price":"$ 79.95" }, { "text":"Blue Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/00731ed18eff0ad5da890d876c456c3124a4e44cb48196533e9b95fb2b959b7194c2dc7637b788341d1ff4f88d1dc88e23f7e3704726d313c57f350911dd2bd0.png", "price":"$ 79.95" } ], "receipt":true, "name":"Sample Name", "address01":"1234 Fake St.", "address02":"Apt. 123", "city":"Place", "state":"CO", "zip":"80202" } } ], "template_id":"[template_id]" }' ``` It is important to note 2 sections of this call when using dynamic templates: In order to send dynamic content, you need to specify a JSON blob containing the dynamic data your template will use in the `dynamic_template_data` object. The Handlebars script you write will refer to the values in your JSON blob by referencing the JSON key, check out [these examples]({{root_url}}/for-developers/sending-email/using-handlebars/#handlebarjs-reference). This Handlebars templating can be used in the text, html, and subject lines of your template. ``` "dynamic_template_data":{ "total":"$ 239.85", "items":[ { "text":"New Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/8dda1131320a6d978b515cc04ed479df259a458d5d45d58b6b381cae0bf9588113e80ef912f69e8c4cc1ef1a0297e8eefdb7b270064cc046b79a44e21b811802.png", "price":"$ 79.95" }, { "text":"Old Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/3629f54390ead663d4eb7c53702e492de63299d7c5f7239efdc693b09b9b28c82c924225dcd8dcb65732d5ca7b7b753c5f17e056405bbd4596e4e63a96ae5018.png", "price":"$ 79.95" }, { "text":"Blue Line Sneakers", "image":"https://marketing-image-production.s3.amazonaws.com/uploads/00731ed18eff0ad5da890d876c456c3124a4e44cb48196533e9b95fb2b959b7194c2dc7637b788341d1ff4f88d1dc88e23f7e3704726d313c57f350911dd2bd0.png", "price":"$ 79.95" } ], "receipt":true, "name":"Sample Name", "address01":"1234 Fake St.", "address02":"Apt. 123", "city":"Place", "state":"CO", "zip":"80202" } ``` In addition to specifying the dynamic template data, you need to specify the template ID. The template ID is 64 characters with one dash (d-uuid). If you forget your template ID and want to access it from the API, use the following curl call to retrieve all of your transactional templates: ``` curl --request GET \   --url 'https://api.sendgrid.com/v3/templates?generations\%5C=legacy&generations\%5C=dynamic' \   --header 'Authorization: Bearer <<YOUR_API_KEY>>' \   --header 'Content-Type: application/json' ``` You can also copy your template ID from the app and paste it into your call. ![]({{root_url}}/img/dynamic_template_id.png 'Dynamic Template ID') ## Additional Resources - [Mail Send with Dynamic Templates](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send#handlebars) - [Unsubscribe Groups]({{root_url}}/ui/sending-email/group-unsubscribes/) - [Using Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) ================================================ FILE: content/docs/ui/sending-email/how-to-send-email-with-marketing-campaigns.md ================================================ --- layout: page weight: 99 title: How to Send Email with new Marketing Campaigns group: marketing-campaigns order: 1 navigation: show: true seo: title: How to Send Email with Marketing Campaigns override: true description: Send your first email using the new Marketing Campaigns tool. --- <call-out> This page refers to the new Marketing Campaigns product. If you’re using legacy Marketing Campaigns, your workflow will be a little different and your screen won’t look the same as the screenshots. </call-out> <iframe src="https://player.vimeo.com/video/305551346" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> <call-out> If you want to send email programmatically using Twilio SendGrid's Email API, see the [API reference]({{root_url}}/api-reference/) or the [SMTP Reference]({{root_url}}/for-developers/sending-email/getting-started-smtp/). </call-out> ## Before you send your first email with Marketing Campaigns <call-out type="warning"> Before you begin, go to your SendGrid [account settings](https://app.sendgrid.com/settings/account) to verify that your timezone and account email address are correct. Verifying your account information ensures that when you upload contacts, you receive notifications and that we deliver scheduled email at the right time. You can also add additional email addresses to receive account notifications by going to the Marketing page and selecting **Notifications**. From Notifications, you can add a different email address to which we will send important account notifications, like contact export activity. </call-out> ### Change your time zone Your time zone is set at the account level, you’ll need to navigate to your account settings to change it. 1. Near the bottom of the left-hand navigation, select **Settings**. 1. Click **Account Details**, or go [here](https://app.sendgrid.com/settings/account). 1. Locate the _Timezone_ field under **Your Account**, and correct it if necessary. ### Add a sender Specifying a [sender]({{root_url}}/ui/sending-email/senders/) in Marketing Campaigns is required by CAN-SPAM regulations, and provides identity information about where the emails are coming from in each email you send. When you add a sender, you need to specify the following information: - **From name** - the name of the person or company you wish to send email from. - **From email** - the email of the person or company you wish to send email from. - **Reply to email** - the email address of the person or company you want recipients to reply to. (Can also be a role address.) - **Company address** - the physical location of the business you’re sending email on behalf of. - **City** - the city of the business you're sending email on behalf of. - **Nickname** - the nickname is for your reference only; this field will not be displayed to recipients. <call-out> If your email domain doesn't match one of your [authenticated]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) domains, you'll need to verify this email address before using this sender. We'll send this email address a verification email after you save this sender. </call-out> ### Create Notifications By default, notifications about your account's Marketing Campaigns activity, CSV upload summaries, sender verifications, and list or segment exports will send to the email you signed up with on your parent account. You can also opt in to receive email notifications from SendGrid to up to 10 email addresses by following the instructions [here]({{root_url}}/ui/account-and-settings/notifications/). ## Add Contacts Marketing Campaigns offers a number of ways to add contacts to lists, including: - [**CSV Upload**]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#upload-a-csv/) - [**Signup Forms**]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#create-a-signup-form/) ![]({{root_url}}/img/sign-up-form.png 'Sign Up Form') - [**Manually Adding a Contact**]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#add-manually) - [**Contact Management APIs**](https://sendgrid.api-docs.io/v3.0/contacts/) ## Add an Unsubscribe Group [Unsubscribe Groups]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/) provide your recipients with an alternative to opting out of all email that you send, by giving them the opportunity to specify the kinds of email that they would no longer like to receive. 1. Navigate to **Marketing** and click **Unsubscribe Groups**. 1. Click **Add Unsubscribe Groups** if you do not already have any unsubscribe groups, or click **Create New Group** to add a new group. 1. Enter the Group Name and Group Description for your Unsubscribe Group. <call-out type="warning"> The Group Name as well as the Group Description are public-facing and will be visible to your recipients. </call-out> ![]({{root_url}}/img/unsubscribe-group-example.png 'Alt text') 4. Select the checkbox if you want the Unsubscribe Group to display on the unsubscribe preferences page. 5. Click **Save Unsubscribe Group**. 6. Find your newly created Unsubscribe Group, click the action menu, and then click **Preview**. ## Create a Single Send 1. From the left-hand navigation, select **Marketing**. 1. Select **Single Sends**. 1. To create a new one-to-many email, click **Create Single Send**. 1. Select the template that you want to use for your email. <br> You can select a blank template, a custom template that you have already created, or one of SendGrid's responsive pre-built templates. For more information, see [Working with Marketing Campaigns Email Designs]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/). <call-out> You can also create a template from an existing Single Send by selecting the action menu next to the email you'd like to reuse and selecting **Create Template**. </call-out> 5. Select an editor. <br> You can choose between the **Design Editor** and the **Code Editor**. ![]({{root_url}}/img/choose-editor.png) <call-out> The [**Design Editor**]({{root_url}}/ui/sending-email/editor/#the-design-editor) offers users powerful drag & drop editing tools, making it possible to build beautiful emails using a library of content modules like text boxes,images, buttons and more. For those familiar with HTML, there are options to edit the HTML of individual modules, drag in a custom code module, or to import an entire HTML email with drag & drop markup. The [**Code Editor**]({{root_url}}/ui/sending-email/editor/#the-code-editor) provides users who are importing, editing, or crafting custom HTML a robust, IDE-like environment, featuring side-by-side code and preview panes, syntax highlighting, error flagging and image management. </call-out> Inside the Design Editor, you use the **Settings**, **Tags** and **Build** tabs to design and configure your email. Inside the Code Editor, you can click the left **Settings** tab to expand the settings window, and then you can configure your email using the **Settings** and **Tags** tabs. ![]({{root_url}}/img/design-editor-preview.png 'Design Editor Preview') 6. Define key settings like _From Sender_, _Email Subject_, _Preheader_, _Recipients_, and _Scheduling_ by filling in the fields in the **Settings** tab. <call-out type="warning"> When selecting segments, make sure you are limiting your selection to 10 segments. </call-out> <call-out> If you have dedicated IPs, you can set up [IP Pools]({{root_url}}/ui/account-and-settings/ip-pools/) that allow you separate your traffic and potentially enhance your deliverability by protecting your sender reputation. To utilize IP pools for Single Sends, navigate to **Settings** and from the IP Pool drop-down, select the IP pool you wish to use. </call-out> 7. Add your custom content by clicking the **Build** tab in the Design Editor, or by editing the HTML code in the Code Editor. ![]({{root_url}}/img/build-tab.png 'Build tab') <call-out> Make sure to include the [{{{unsubscribe}}}]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/) tag to test and send your campaign. For more information about customizing your campaign, see [Using the Design Editor]({{root_url}}/ui/sending-email/editor/#the-design-editor) or [Using the Code Editor]({{root_url}}/ui/sending-email/editor/#the-code-editor). </call-out> ## Sending your First Email <iframe src="https://player.vimeo.com/video/385339044" width="640" height="480" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> 1. As you're editing your email, you can see what it looks like by clicking **Preview** from within the design editor, or, from the code editor simply toggle between **Desktop**, **Mobile**, and **Plain text**. You can also preview from the Single Sends index page by hovering over the action menu and clicking **Preview**. 2. You can test your email by sending it to yourself and up to 10 other recipients. We'll automatically append "Test - " to the subject line so your recipients know it's a test and not the real send. From **Settings**, click **Test Your Email** and enter the email addresses to send your test to. 3. For more robust, automated testing, we offer [Email Testing]({{root_url}}/ui/sending-email/email-testing/) for both Automation and Single Sends so you can see what your email looks like across different operating systems, browsers, and inboxes. 4. With your email fully tested and ready to go, click **Send** or **Schedule**. You'll have the chance to do a final review of settings before confirming your send! ## Additional Resources - [Sending with Email API]({{root_url}}/for-developers/sending-email/api-getting-started/) - [Campaign Statistics]({{root_url}}/ui/analytics-and-reporting/marketing-campaigns-stats/) - [Getting Started with Automation]({{root_url}}/ui/sending-email/getting-started-with-automation/) - [Reading your invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/) ================================================ FILE: content/docs/ui/sending-email/image-editor.md ================================================ --- layout: page weight: 81 title: Image Editor group: building-email navigation: show: true seo: title: Image Editor override: true description: Twilio SendGrid Marketing Campaigns' image editor allows you to crop, flip, and filter images to help you create the perfect design without the need for any other tools. --- Twilio SendGrid’s Marketing Campaigns provides a built-in image editing tool that allows you to crop, flip, and filter your photos. This article provides an overview of the editor and its features with additional tips to make your images look their best. <call-out> Because the Image Editor is available within the [Design Library](https://mc.sendgrid.com/design-library/your-images), you can edit images you send with the Email API as well as Marketing Campaigns. </call-out> ## Image Library You can upload new images and access existing images in the Marketing Campaigns Image Library. Supported file types include .jpg, .gif, and .png. To access the Image Library, navigate to [Design Library > Your Images](https://mc.sendgrid.com/design-library/your-images) in the sidebar navigation of the SendGrid App. You can also access the Image Library while editing a Single Send or Automation email by adding an image into your content and clicking “Edit Image.” ![The Image Library landing page in the SendGrid App. Here you can upload new images or select existing images to edit.]({{root_url}}/images/mc-image-library-landing-page.png 'The Image Library landing page') To upload an image, you can either drag an image onto the page where it says, "Drag and drop your images here, or choose images to upload." If you click the "choose images to upload" link, a system dialog will open, allowing you to browse for images on your computer. ![Upload a new image to the Image Library]({{root_url}}/images/mc-image-library-upload-new-image.png 'Upload a new image to the Image Library') The Image Library displays all images you previously uploaded. You can click any of these images to load a sidebar overlay that displays the image's details. You will also have the option to delete the image, edit the image, or copy the image URL. ![A sidbar modal showing an image's details and allowing you to delete the image, edit the image, or copy the image's URL]({{root_url}}/images/mc-image-library-image-detail-modal.png 'Image details with options to delete or edit an image') ## Image Editor To access the image editor, open the [Image Library](https://mc.sendgrid.com/design-library/your-images/) and upload a new image or select a pre-existing image that you would like to edit. With an image selected, the detail menu mentioned above should load. Select "Edit Image" from this menu. ![The edit button highlighted inside the image details menu]({{root_url}}/images/mc-image-library-image-edit-image-button.png 'Select edit to load the Image Editor') <call-out> You can also access the Image Editor by editing images already placed in your Single Sends and Automations designs. For more on Email Design, see [Working with Marketing Campaigns Email Design]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/) </call-out> Once in the Image Editor, you will have three primary actions available, "Transform," "Filter," and "Adjust." Each category contains multiple actions that can be performed on your image. More details about these actions is provided below. When saving edits to your images, a new image will be saved to your Image Library. This allows you to modify an image without overwriting your original photo. You can select "Cancel" at any time to abandon your edits without saving. <call-out> You can save images in either the JPG or PNG format. If your image must support transparency, save the file in PNG format. JPG does not support transparency. </call-out> ![The Image Editor landing page shows the top level editor actions on the left and an image preview on the right]({{root_url}}/images/mc-image-editor-landing-page.png 'The Image Editor landing page') <call-out> Images cannot be larger than 4MB. </call-out> ### Transform The transformation actions include cropping, flipping, and rotating an image. #### Crop <call-out> Cropping an image can change its composition to help communicate your story. Common guidelines for framing and cropping images include the [rule of thirds](https://en.wikipedia.org/wiki/Rule_of_thirds) and the [golden ratio](https://en.wikipedia.org/wiki/Golden_ratio#Applications_and_observations). </call-out> - Freeform: crop the image to any desired width and height - Landscape: crop the image with a fixed 4:3 aspect ratio - Portrait: crop the image with a fixed 3:4 aspect ratio #### Flip and rotate - Rotate: rotate the image 90 degrees clockwise - Flip Horizontally - Flip Vertically ### Filter The provided filters can help quickly alter a photo to create a look and feel without manual adjustments. ### Adjust The adjustment actions allow you to manually alter multiple image settings. These manual adjustments can be used to modify an unedited photo or to further refine a look after you have applied a filter. <call-out> Altering an image's color balance, contrast, and saturation is a powerful way to control your messaging. [Color theory](https://www.smashingmagazine.com/2010/01/color-theory-for-designers-part-1-the-meaning-of-color/) is the way designers and artists use color to communicate. </call-out> - Hue: adjust the image's color balance - Saturation: adjust the intensity of the hues in the image - Brightness: raise or lower the overall luminosity of the image - Contrast: adjust the difference between the least and most intense image tones - Opacity: control the image's transparency - Blur: apply blur to the image - Sepia: apply a sepia tone to the image - Grayscale: convert the image to grayscale (this is similar to desaturating the image) ================================================ FILE: content/docs/ui/sending-email/index-suppressions.md ================================================ --- layout: page weight: 100 title: Suppressions Overview group: tracking seo: title: SendGrid Suppressions Overview description: SendGrid will suppress emails that your recipients unsubscribe from or that recipient email servers reject. keywords: suppressions, unsubscribes, email suppressions, email unsubscribes navigation: show: true --- ## Suppressions vs. Unsubscribes An unsubscribe is the action an email recipient takes when they opt-out of an email list. Typically, this is done by clicking the unsubscribe link in the email. A suppression is the action the sender takes by no longer sending to an email address when a recipient has opted out of an email list or when the recipient’s email server or provider has rejected emails sent to that address. This is an important distinction, because from the point of view of your recipients, you as the SendGrid customer are the sender. We have made this distinction in order to clearly define the difference between an action a recipient takes and an action SendGrid takes on your behalf. <call-out type="warning"> Each email you attempt to send to a suppressed address will consume one email from your account. </call-out> ## Managing Unsubscribes Managing unsubscribes is key to getting maximum email delivery. If your recipients have an easy way to tell you that they’d like to stop receiving your email, instead of using the spam button, it will give you valuable insights without affecting your reputation. SendGrid has three different ways of processing unsubscribes depending on how you’re sending mail. If you use [Subscription Tracking]({{root_url}}/ui/sending-email/subscription-tracking/), recipients can unsubscribe from all of the emails you’re sending. As a transactional mail user, you also have the option to create unsubscribe groups for your transactional templates using Advanced Suppression Management. Alternatively, if you’re sending Marketing Campaigns, recipients can unsubscribe from specific types of emails that they’d rather not receive anymore, also known as [Unsubscribe Groups]({{root_url}}/ui/sending-email/unsubscribe-groups/). If you are sending Transactional email through the SendGrid API or SMTP and have the Subscription Tracking setting turned on, an unsubscribe option will be added to the footer of every email that gets sent through your account. A user who clicks the unsubscribe link will be added to your global unsubscribe list and **any** future attempts to send email to those users will be suppressed, unless they’re removed. You can also manage this list manually, adding and removing addresses via the UI or with the use of API calls. The Subscription Tracking setting also has a number of options for customization, such as a replacement tag that allows you to place the unsubscribe text somewhere in the body of the email, the ability to reword the unsubscribe message, and the ability to add a custom landing page. If using Advanced Suppression Management in place of Subscription Tracking, an ASM tag must be included in the template. - We will replace the tag with the text "Unsubscribe From All Emails" if you include `<%asm_global_unsubscribe_url%>` - We will replace the tag with the unsubscribe URL but **without** the hyperlinked tag if you include `<%asm_global_unsubscribe_raw_url%>` - We will replace the tag with the text "Unsubscribe from this list" if you include `<%asm_group_unsubscribe_url%>` - We will replace the tag with only the group unsubscribe URL **without** the hyperlinked text if you include `<%asm_group_unsubscribe_raw_url%>` ## Different Types of Suppressions SendGrid automatically suppresses emails sent to users for a variety of reasons in order to aid our customers in having the best possible reputation they can have by attempting to prevent unwanted mail. **[Blocks]({{root_url}}/ui/sending-email/blocks/)** - The recipient's email server rejects the message for a reason related to the message, not the recipient address. This may be due to your Sending IP, or the message content. Since these are message-specific issues, future messages to these addresses are _not_ suppressed. **[Bounces]({{root_url}}/ui/sending-email/bounces/)** - The recipient’s email server rejects the message, or sends the message back to SendGrid, due to an issue with the recipient address. **[Invalid Emails]({{root_url}}/ui/sending-email/invalid-emails/)** - The recipient address does not exist at the mail server you sent to. **[Spam Reports]({{root_url}}/glossary/spam-reports/)** - The recipient marks your email as spam. **[Global Unsubscribes]({{root_url}}/ui/sending-email/global-unsubscribes/)** - When a user unsubscribes from everything you might email them. **[Group Unsubscribes]({{root_url}}/ui/sending-email/group-unsubscribes/)** - When a user unsubscribes from a specific group of your emails. ## Bypass suppressions Bypass filters allow you to disregard unsubscribe groups and suppressions to ensure that an email is delivered to all recipients, whether or not they are on a suppression or unsubscribe list. It is important to respect unsubscribes, and these filters should be used only when it is absolutely necessary to deliver a message to recipients who have unsubscribed from your emails. For example, you may use these filters to deliver messages that you are legally required to send to all recipients or important security messages like a password reset. ### Bypass list management Both the [X-SMTPAPI header]({{root_url}}/for-developers/sending-email/smtp-filters/#filter-bypass_list_management) and the [v3 Mail Send API](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) accept the `bypass_list_management` filter. By setting the `bypass_list_management` filter to `true`, your message will bypass all unsubscribes and suppressions in **all** lists. ### Bypass filters and v3 Mail Send The v3 Mail Send API provides three filters in addition to `bypass_list_management`. These additional filters allow you to bypass a single list. You can also pass multiple bypass filters to the v3 Mail Send API to target a combination of lists; however, the `bypass_list_management` filter cannot be combined with any other bypass lists. When using the `bypass_list_management` filter, you are disregarding all lists, and any more granular bypass settings will be ignored. Each filter should be sent via the `mail_settings` field as an object with a single boolean field called `"enable"`. When a filter is set to `true`, Twilio SendGrid will disregard or _bypass_ the unsubscribe or suppression status of the addresses in the list, delivering the message to the recipients. See the [v3 Mail Send API reference](https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send) for examples. - Bypass spam management - By setting the `bypass_spam_management` filter to `true`, your message will bypass the spam report list. The bounce and global unsubscribe lists will be checked and respected. - Bypass bounce management - By setting the `bypass_bounce_management` filter to `true`, your message will bypass the bounce list. The spam report and global unsubscribe lists will be checked and respected. - Bypass unsubscribe management - By setting the `bypass_unsubscribe_management` filter to `true`, your message will bypass the global unsubscribe list. The spam report and bounce lists will be checked and respected. Note that this bypass filter is applied to global unsubscribes only; group unsubscribes will be checked and respected. ## Additional resources - [Unsubscribe Groups]({{root_url}}/ui/sending-email/unsubscribe-groups/) - [Create and Manage Unsubscribe Groups]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/) ================================================ FILE: content/docs/ui/sending-email/invalid-emails.md ================================================ --- layout: page weight: 0 title: Invalid Emails group: delivery-optimization seo: title: Invalid Emails description: When an email is malformed or a mailbox provider says the email is invalid, SendGrid will keep these reports for you. keywords: invalid emails, malformed emails navigation: show: true --- An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server. Examples include addresses without the “@” sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. Before you send, SendGrid does a check against the format of the email address to attempt to verify its validity. If the recipient server checks the address and doesn't find it, they will send back a 550 bounce to say that this is an invalid email address. <call-out> Invalid drop events are retained for 30 days. </call-out> ## Searching Invalid Emails by Date In the top right corner, you will see a calendar icon. Click this and choose the dates you would like to search between. Your recipient list will refresh, showing the invalid email address reports from between those dates. ## Removing Recipients From The List When you select the checkboxes next to the recipient names or select all, using the checkbox next to the search box, you will see a new button at the top of the page. From this list, you can choose to remove the selected recipients from the list. ## Download Invalid Emails as CSV You can download your list as a CSV by clicking the gear icon at the top of the page and selecting “Download CSV.” The file will download in your browser right away. ## Additional Resources - [Recipient Subscription Preferences]({{root_url}}/ui/sending-email/recipient-subscription-preferences/) - [Spam Reports]({{root_url}}/ui/sending-email/spam/) - [Invalid Emails API](https://sendgrid.api-docs.io/v3.0/invalid-emails-api) ================================================ FILE: content/docs/ui/sending-email/ip-warmup-for-the-new-marketing-campaigns-experience.md ================================================ --- layout: page weight: 70 title: IP Warmup with Marketing Campaigns group: delivery-optimization navigation: show: true seo: title: IP Warmup with Marketing Campaigns keywords: IP, warmup, deliverability, new Marketing Campaigns override: true Description: Directions for warming up a dedicated IP address using the new Marketing Campaigns experience. --- ## What is IP warming? IP warming is the practice of gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with inbox providers (Gmail, Yahoo, etc.) as a legitimate email sender. If you immediately begin sending large amounts of mail, you will risk having your messages blocked by inbox providers. If you’re using an Advanced Marketing Campaigns plan, or if you have a dedicated IP as part of your Email API plan, this article will help you identify the right warmup strategy for your email program. ## How to know if you have a dedicated IP The Marketing Campaigns Advanced package, as well as Email API Pro and Premier packages, all include a dedicated IP. With any of these packages, you’re also able to purchase additional IPs. To view your IPs, navigate to **Settings** and click **IP Addresses**. <call-out> If you have existing dedicated IPs from your Email API package that are already warmed up, you still need to warm up your new Advanced Marketing Campaigns dedicated IP. </call-out> If you’ve been sending through the Basic Marketing Campaigns package and you’re on an Essentials Email API plan, you’ve been sending on a shared IP. This means when you upgrade to a package that includes a dedicated IP, you’ll still need to go through the warmup process. Inbox providers expect your traffic to come from shared IPs, so when you begin sending over your new IP inbox providers will see this as a new, “cold” mailstream. ## How to schedule IP warmup with Marketing Campaigns Depending on the maximum daily volume you plan to send, a warmup can take anywhere from a few days to a few weeks. Our general recommendation is to send no more than 50 emails on your new IP address on your first day of sending. From there, you’ll want to double your volume every concurrent day you send until you’ve reached the maximum daily volume you plan on sending. At that point, inbox providers will be more familiar with your sender reputation, and you will fully warmup your IP. You can use the Marketing Campaign’s scheduling and contact management tools to create a warmup schedule. First, you’ll want to split up your contacts into lists, where the number of contacts in each list is associated with a day of warmup. For example, if 800 messages per day was your maximum daily send volume, you’d want to create contact lists of 50, 100, 200, 400, and 800. You’d send to the list of 50 on day one, the list of 100 on day two, and so on. *To upload these lists:* 1. Navigate to the **Marketing** tab. 1. Select **Contacts**. 1. Create a new list titled “Day 1” and [upload]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#add-contacts) your first group of 50 contacts to this list. <call-out> Ensure that you [format your contact lists correctly]({{root_url}}/ui/managing-contacts/formatting-a-csv/) before continuing. </call-out> Continue creating new lists for each day of your warmup and upload the associated number of contacts for each day. When you finish, you should have a list for every day in your warmup with the number of contacts in each day doubling. Next, you’ll want to create a template for your warmup campaign. *To create a template:* 1. Navigate to **Marketing** and then select **Templates**. 1. Click **Create Template** and select the [editor]({{root_url}}/ui/sending-email/editor/) you want to use to create your template. 1. Once you’ve finished creating your template, exit out of the editor and hover over the action menu next to the template and select **Create Single Send**. 1. Add the “Day 1” list to your Single Send recipients by navigating to **Recipients**, and then selecting **Schedule**. 1. Click **Send Immediately** to change it to a day you'd like to begin the warmup. After you schedule your first send, you can navigate back to your template and repeat steps 3 and 4 above, making sure you update the list used for Day 2 and choose the next day in the scheduling menu. Repeat this process until you have a campaign for every single day in your warmup. Congrats! You’re all set to successfully warm up your new IP address with marketing mail! ## Sending with multiple dedicated IPs If you have multiple dedicated IPs, whether from your previous Email API package, your Advanced Marketing Campaigns plan, or from purchasing additional IPs, your Marketing Campaigns sends will be sent “round-robin” across all IPs on your account on a per-email basis. This means if you send a Single Send to 100 recipients, the 100 emails well send equally across each IP you have. If you wish to send a Single Send or Automation email from a specific IP address, you can do so by creating an [IP Pool]({{root_url}}/ui/account-and-settings/ip-pools/). Once your IP Pool is created, you can select it as you draft your email by navigating to Settings, clicking the IP Pool drop-down, and selecting the IP pool you wish to use. <call-out type="warning"> To optimize your IP reputation, we recommend you do not send your marketing and transactional (Email API) emails from the same IP. To avoid this, [create a subuser account]({{root_url}}/ui/account-and-settings/subusers/#create-a-subuser). </call-out> ================================================ FILE: content/docs/ui/sending-email/legacy-newsletter-sunset.md ================================================ --- layout: page weight: 100 group: building-email title: Legacy Newsletter Sunset hideFeedback: false showTitle: false breadcrumbs: true navigation: show: false seo: title: Legacy Newsletter Sunset description: Assets to help you migrate from Legacy Newsletter to Marketing Campaigns --- <header class="page-header"><h1>Legacy Newsletter Sunset</h1></header> <call-out type="warning"> Legacy Newsletter has been retired. </call-out> Your email marketing needs can now be met by [Marketing Campaigns](https://sendgrid.com/solutions/email-marketing/), which offers a best in class editing experience, contact segmentation for powerful targeting, and actionable analytics to help you measure and improve your results. Ready to give Marketing Campaigns a try? You can upload your first [2,000 contacts](https://app.sendgrid.com/login?redirect_to=%2Fmarketing_campaigns%2Fui%2Fwelcome) for free today. <iframe src="https://player.vimeo.com/video/185514373" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> ## Additional Resources * [Marketing Campaigns Overview]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) * [Adding Contacts]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/) * [Segmenting your contacts]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) ================================================ FILE: content/docs/ui/sending-email/list-unsubscribe.md ================================================ --- layout: page weight: 0 title: List-Unsubscribe group: tracking seo: title: List-Unsubscribe description: Include the List-Unsubscribe header to provide your recipients with an unsbuscribe link next to the From address used to deliver mail. keywords: unsubscribe, delivery, reputation, tracking navigation: show: true --- [List-Unsubscribe](https://sendgrid.com/blog/list-unsubscribe/) is a small piece of text that can be inserted in the header section of your email. The List-Unsubscribe header will insert an “unsubscribe” button, or link, next to the From address at the top of your email. A recipient can click this link to notify you that they would like to unsubscribe from your emails. ```json { "List-Unsubscribe": "<mailto:unsubscribeexampexample@example.com>, <http://www.unsubscribe.example.com/>" } ``` ![List-Unsubscribe Email Example]({{root_url}}/img/list_unsubscribe_1.png "List-Unsubscribe Email Example") <call-out type="warning"> It is important to note that the list-unsubscribe header is not a complete replacement for the standard unsubscribe functionality that should be included in the body of your email. For more information on adding unsubscribe links to the body of your email, see our [Unsubscribe Groups documentation]({{root_url}}/ui/sending-email/unsubscribe-groups/). </call-out> ### SendGrid’s Subscription Tracking If you enable SendGrid’s [subscription tracking](https://app.sendgrid.com/settings/tracking) feature, SendGrid will automatically insert the List-Unsubscribe header in all of your text and HTML emails— placing an unsubscribe link in all of your emails. Alternatively, you can place the substitution tag [unsubscribe] anywhere in the body of your email to specify the exact location where you want the unsubscribe link to appear. You may customize this tag and the message inserted during the substitution. For more information, see our [subscription tracking documentation](https://sendgrid.com/docs/ui/account-and-settings/tracking/). It is possible to use the List-Unsubscribe header even if you do not want to use subscription tracking. This is useful for users who want to provide their recipients an easy way to unsubscribe from their emails without relying on SendGrid’s tracking features. Continue reading below for an explanation of the List-Unsubscribe header, and how you can use it when sending email via SendGrid. ## How does the List-Unsubscribe header work? The List-Unsubscribe header provides two methods of unsubscribing users: an email unsubscribe, and a web unsubscribe. One, or both, of these methods may be used. ### Email Unsubscribe: mailto The mailto portion of the List-Unsubscribe header allows you to specify an email address that will receive the unsubscribe request. In other words, when a recipient clicks the “unsubscribe” link in your email, the recipient’s mail client will send an email to this address. **It is your responsibility to receive and process these generated emails**. ### Web Unsubscribe: http The http portion of the List-Unsubscribe header allows you to specify a URL that will receive a POST whenever someone clicks the unsubscribe link in your email. <call-out type="warning"> Failure to honor your recipients’ unsubscribe requests may do more than damage your sender reputation. To learn more about deliverability and compliance, see our [2019 Email Deliverability Guide](https://sendgrid.com/blog/sendgrids-2019-email-deliverability-guide/). </call-out> ## Which method should I use? You must include at least the **mailto** portion of the List-Unsubscribe header, since some services only support this portion (iOS, for example). However, many inbox providers and mail clients honor both methods. To ensure that the greatest number of your recipients have the ability to unsubscribe from your emails, thus protecting your reputation as a sender, we recommend including both **mailto** and **http**. Not honoring your recipients’ unsubscribe requests could not only harm your sender reputation, but could also violate legislation laid out in [CAN-SPAM](https://sendgrid.com/docs/glossary/can-spam/), [CASL](https://sendgrid.com/blog/canadian-anti-spam-law-need-know/), and other legislation. For more information about deliverability best practices and compliance, please visit our [Deliverability Overview](https://sendgrid.com/docs/ui/sending-email/deliverability/). ## Examples ### Using List-Unsubscribe with v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "example@example.com" } ], "subject": "Your subject line here" } ], "from": { "email": "example@example.com" }, "content": [ { "type": "text/plain", "value": "Hello, World!" } ], "headers": { "List-Unsubscribe": "<mailto:unsubscribeexampexample@example.com>, <http://www.unsubscribe.example.com>" } } ``` ### Using List-Unsubscribe with v2 Mail Send ``` api_user=your_sendgrid_username& api_key=your_sendgrid_password& to=destination@example.com& toname=Destination& subject=Example_Subject& text=testingtextbody& from=info@domain.com& "headers": {"List-Unsubscribe": "<mailto:unsubscribeexampexample@example.com>, <http://www.unsubscribe.example.com>"} ``` ### List-Unsubscribe with SMTP ```json { "List-Unsubscribe": "<mailto:unsubscribeexampexample@example.com>, <http://www.unsubscribe.example.com/>" } ``` ================================================ FILE: content/docs/ui/sending-email/migrating-from-legacy-marketing-campaigns.md ================================================ --- layout: page weight: 70 title: Migrating from legacy Marketing Campaigns group: marketing-campaigns navigation: show: false seo: title: Migrating from legacy Marketing Campaigns keywords: override: description: Use this guide to migrate from legacy to the new Marketing Campaigns experience. --- ## What does Marketing Campaigns offer? The new Marketing Campaigns builds on the existing, well-loved workflows for building, targeting, sending, and measuring email marketing campaigns with three new features: Automation, Email Testing, and Signup Forms. ### Automation Create a recurring email or series of emails that send automatically whenever a contact joins a list or segment. Choose when each email sends, and whether a contact should exit the automation if they no longer meet the entry criteria. [Learn More]({{root_url}}/ui/sending-email/getting-started-with-automation/). ### Email Testing Have confidence your emails are flawless with integrated email testing. See how emails render across the inboxes, browsers, and device types that matter to your business, ensure links within your email are valid, and know how your email will perform against the most powerful spam filters. [Learn More]({{root_url}}/ui/sending-email/email-testing/). ### Signup Forms Capture new signups and add them directly to your contacts in the new Marketing Campaigns. These forms can be embedded directly on your website or shared via a Twilio SendGrid-hosted URL. [Learn More]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#create-a-signup-form). ### Familiar features and functionality from legacy These new features build on the functionality you’re used to in legacy Marketing Campaigns. This means after a few migration steps, you’ll be up and running quickly thanks to familiar workflows you already know. All features from legacy Marketing Campaigns will be carried over to Marketing Campaigns, though there are a few that will not be available immediately. You can track those items on our [coming soon to Marketing Campaigns page]({{root_url}}/ui/sending-email/coming-soon-to-new-marketing-campaigns/). <call-out> What you’re used to as “Campaigns” in legacy Marketing Campaigns is now called “Single Sends” in Marketing Campaigns. </call-out> ## Why aren’t you migrating my account automatically? Marketing Campaigns has been re-built from the ground up on a new platform, which brings benefits like increased speed, scale, and stability. However, because it’s an entirely new product, it is not connected to the legacy Marketing Campaigns, and we’re not yet able to automatically move your assets and data. To support you in migrating your legacy Marketing Campaigns account to Marketing Campaigns, we’re providing you with a billing grace period. During this grace period, you won’t be charged for legacy Marketing Campaigns contact storage. The grace period covers the month you upgrade to a Basic or Advanced package and 1 month after you upgrade. ## Choosing a new Marketing Campaigns plan ### How is the pricing different for the new plans? **Legacy Marketing Campaigns Pricing** With the legacy offering, you selected a base Email API plan to cover all email sends whether via Email API or Marketing Campaigns. Next, you paid \$10 per 10,000 contacts you **stored** in Marketing Campaigns. Any emails you sent using Marketing Campaigns were deducted from your base Email API plan allotment. If you sent over your plan allotment, you were charged overages per additional email. **New Marketing Campaigns Pricing** With the new Marketing Campaigns, you choose a Marketing Campaigns package, either Basic or Advanced. Basic starts at $15/mo and Advanced starts at $60/mo. The package includes an allotment of both contacts you can upload and emails you can send. If you send over your allotment of emails or **upload** more contacts you will be charged an additional fee per email or contact. **Deleting contacts does not reset the total count for contacts uploaded**. Any emails you send via new Marketing Campaigns are deducted from your Marketing Campaigns package, not from your Email API plan. ### What are the new package options? There are three new packages for Marketing Campaigns, Free, Basic, and Advanced. For complete pricing and feature detail, please visit our [pricing page](https://sendgrid.com/pricing/). To upgrade your current page, go to **Settings** and then select **Your Products**. <call-out> You have access to the Free plan by default, allowing you to explore new Marketing Campaigns risk-free today! </call-out> **Free** Try it out! Send up to 6,000 emails to 2,000 contacts per month. - Automation - Single Sends for one-time campaigns - Segmentation - Ticket Support - 3 Email Testing Credits per month - 1 Signup Form **Basic** Starting at \$15/month for 5,000 contacts and 15,000 email sends - Single Sends for one-time campaigns - Segmentation - Ticket, Chat & Phone Support - 10 Email Testing Credits per month with the option to purchase more - 5 Signup Forms - 1 Teammate - Access to Expert Services **Advanced** Starting at \$60/month for 10,000 contacts and 50,000 email sends - Automation - Single Sends for one-time campaigns - Segmentation - Ticket, chat, and phone Support - 60 Email Testing Credits per month with the option to purchase more - 15 Signup Forms - 1,000 Teammates - Access to Expert Services - Subuser Management - Dedicated IP included; option to purchase more IPs ### What should I consider in choosing a new package? To decide the best package for your needs, Basic or Advanced, consider the features you’d like included in your Marketing Campaigns package, your historical usage with legacy Marketing Campaigns, and what access to add-ons you need. _Features you’d like to access_ Choose **Advanced** if you’d like any of the following features. A complete summary of the feature set for each Marketing Campaigns package can be found on [our pricing page](https://sendgrid.com/pricing/). - Automation - Greater allotment of monthly Email Testing credits - Greater allotment of Signup Forms - Dedicated IPs\* - Greater allotment of Teammates\* - Ability to create or manage subusers\* <call-out> \*These features are also available on the Pro and Premier Email API packages. If you have access via your Email API package, you can also use these features for your Marketing Campaigns sending. </call-out> Choose **Basic** if following features meet your needs. A complete summary of the feature set for each Marketing Campaigns package can be found on [our pricing page](https://sendgrid.com/pricing/). - Single Sends for one-time campaigns - Ticket, Chat, and Phone Support - 10 Email Testing Credits per month with the option to purchase more - 5 Signup Forms - 1 Teammate - Access to Expert Services _Historical usage_ Review how many contacts you store in legacy Marketing Campaigns as a starting point, then consider if or how you may grow your audience. Do the same for in considering your legacy Marketing Campaigns sending volume by adding up the number of delivered emails across your campaigns. Remember, the new Marketing Campaigns packages also include email sends, so if you only send via Marketing Campaigns, you’ll potentially no longer need to subscribe to an Email API plan. <call-out type="warning"> **Please note:** Downgrading from a paid Basic or Advanced Marketing Campaigns plan to a Free account will permanently delete all contacts associated with that account. You will need to reimport any contacts that you would like to use with your Free account. </call-out> _Add-ons you need_ There are some add-ons that are only available with certain package types. **Additional dedicated IPs** can only be purchased if you have either a Pro or Premier Email API plan or an Advanced Marketing Campaigns plan. **Email Activity Feed** is only available if you’re on a paid Email API plan. ### Do I need to change my Email API plan? You don’t need to change your Email API plan. However, depending on your feature needs and usage, it may make sense to review your plan and make an adjustment. To start, consider how many emails you typically send through Email API vs. Marketing Campaigns when making your decision. _Example_: You currently have a **Pro 300K Email API plan** and store **45,000 contacts** in Marketing Campaigns. **Net cost is \$369.00** ($249.00 + $120). In an average month, you send 90,000 emails via Email API, and 150,000 emails through Marketing Campaigns. You want to use the new Advanced Marketing Campaigns features, including Automation. In this scenario, you might choose to change your Email API plan to **Pro 100K** and choose the **Marketing Campaigns Advanced 50K plan. Net cost will be \$339.95** ($89.95 + $250). You can send 100,000 emails via Email API and 250,000 emails using Marketing Campaigns. ## How do I upgrade my Marketing Campaigns plan? 1. Navigate to **Settings**, click **Account Details**, and then **Your Products**. 1. Review your current plan details as well as your usage this month. It’s helpful to have a sense of how many emails you’re sending and how many contacts you store. <call-out> You can review prior usage by navigating to **Invoices** under **Plan & Billing**, and checking your invoices there. Take a look at [Reading your Invoice]({{root_url}}/ui/account-and-settings/reading-your-invoice/) to learn more about reading and understanding your invoices. </call-out> 3. Click **Upgrade Plan** to choose your new Marketing Campaigns plan. 4. By default, your plan will be Free 2K. To select a new plan, start by deciding whether you want Basic or Advanced features. 5. Next, choose the right tier of contact storage and volume of emails that you’ll send using Marketing Campaigns in a given month. <call-out> Need a higher tier of contact storage or email volume? Simply scroll to the bottom of the page to request custom pricing. Today, we support storing up to 1M contacts. </call-out> 6. Click **Select** to review your plan choice. You’ll see your new Marketing Campaigns plan monthly price, as well as the prorated price you’ll pay for the current month. 7. Click **Confirm**. <call-out> No change will be made to your legacy Marketing Campaigns account as a result of buying a new Marketing Campaigns package. You'll have **through** the next complete month to migrate your account to avoid being charged for both versions, as outlined below. </call-out> To support your migration effort, you’ll have a billing grace period through the next complete billing cycle to migrate your contacts from legacy Marketing Campaigns to new Marketing Campaigns. During this grace period, which **includes the month you upgrade and the month following your upgrade**, you will not be charged for contact storage in legacy Marketing Campaigns. <call-out type="warning"> If you have more than 2,000 contacts in legacy Marketing Campaigns at the end of the billing grace period, you’ll be charged \$10 per 10,000 legacy Marketing Campaigns contacts moving forward. </call-out> ## Migrate your contacts You can choose to migrate all of your contacts to new Marketing Campaigns, or you can migrate specific lists and segments. You can do this via the UI by exporting from legacy and importing to new Marketing Campaigns or you can use the Contact Management APIs. While you can download the contacts who are on a segment at the time you export and add them to All Contacts or a list, you cannot migrate the segment logic you’ve built. You’ll need to re-create [segments]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) you’d like to use in new Marketing Campaigns. _Migrate contacts using the UI_: 1. Navigate to **Contacts** in legacy Marketing Campaigns. 1. Find the list or segment of contacts you wish to export. 1. Hover over the action menu and select the **Export** icon. 1. Once the export is completed, a download link will be sent to the email(s) you either signed up with, or have set to receive [notifications]({{root_url}}/ui/account-and-settings/notifications/). 1. Navigate to **Contacts** in new Marketing Campaigns. <call-out> Before uploading your CSV, make sure it is formatted correctly by comparing it to this [template]({{root_url}}/assets/example.csv). </call-out> 6. Click **Add Contacts** and then select **Upload CSV**. 7. Choose whether to add your contacts to All Contacts, to an existing list, or to a new list you create. 8. Upload your CSV file by dragging it into or clicking the CSV upload area. Make sure all of the column headers you wish to import are mapped to custom fields. <call-out> If there are any column headers you have not made custom fields for yet, you can click on **Select a Field**, and then scroll down the drop-down menu and click **Create New** [**Custom Field**]({{root_url}}/ui/sending-email/custom-fields/). </call-out> 9. Once the CSV file has finished processing, a download link will be sent to the email(s) you either signed up with, or have set to receive [notifications]({{root_url}}/ui/account-and-settings/notifications/). <call-out type="warning"> If you add contacts to any lists being used as the entry criteria for a live [automation]({{root_url}}/ui/sending-email/getting-started-with-automation/), all contacts you add to that list will be entered into the automation. If you add contacts to a list that you’d like to use as the entry criteria for an Automation in the future, note that the automation will only trigger to contacts who are added to the entry criteria list _after_ you set the automation live. </call-out> 10. Once you have migrated your contacts to the new Marketing Campaigns, please [delete your contacts from the legacy Marketing Camapigns]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#delete-all-contacts) to ensure you are no longer charged for contact storage in legacy Marketing Campaigns. ## Migrate your content You may have pre-existing images, templates, or campaigns that you’d like to re-use in Marketing Campaigns. You can transfer your assets into new Marketing Campaigns by following the steps below. ### Templates 1. Navigate to **Templates** in legacy Marketing Campaigns. 1. Select **Custom**. 1. Locate the template you wish to transfer into new Marketing Campaigns. 1. Click the action menu and then select **Export HTML**. The template HTML instantly downloads to the folder specified on your computer. <call-out type="warning"> Images embedded in your templates or past campaigns will continue to populate from your legacy Marketing Campaigns image library. To ensure no images break in the future when legacy Marketing Campaigns is deprecated, consider updating links to pull images from your new Marketing Campaigns image library. </call-out> 5. Navigate to **Design Library** in new Marketing Campaigns and select **Your Email Designs**. 6. Click **Create Email Design**, and then select either the **Design Editor** or the **Code Editor**. 7. If you’re using the **Design Editor**, navigate to **Build**, select **Advanced** and then click **Import Drag & Drop HTML**. If you’re using the **Code Editor**, paste in the HTML into the HTML editor. <call-out> Switching from a template made in the Code Editor into a Design Editor can cause some unwanted changes. Sticking to the editor you started with can help keep this transfer smooth and prevent any formatting issues. </call-out> 8. Paste the HTML you copied from the downloaded file into the code editor and then click **Save** if you are using the **Code Editor**. Click **Update** and then **Save** if you are using the **Design Editor** . Make sure that you are using the new [substitution tags]({{root_url}}/ui/sending-email/editor/#using-substitution-tags). For example, instead of using `[%first_name%]`, you will now use `{{first_name}}`. ![]({{root_url}}/img/substitution-tag-comparison.png 'substitution tag comparison') <call-out> Make sure that your unsubscribe tags and groups are also up to date. You can learn more about how to format these tags [here]({{root_url}}/ui/sending-email/create-and-manage-unsubscribe-groups/). </call-out> ### Campaign designs You may have email designs from campaigns that you’d like to re-use in new Marketing Campaigns that aren’t saved as a standalone template. You can do so by exporting the email content from these campaigns and importing them as a template in new Marketing Campaigns. _To navigate your campaign designs_: 1. Navigate to **Campaigns** in legacy Marketing Campaigns. 1 Locate the campaign you wish to migrate and hover over the action menu until the icons appear. Select the **Export HTML** icon. The campaign HTML downloads to the folder specified on your computer. 1. Navigate to the Automation or Single Sends dashboard. 1. Click into the Automation you want to edit and find the email you want to add the exported HTML to. For Single Sends, click directly into the email you want to add the exported HTML to. 1. Hover over the action menu and select **Add Email Content**. 1. Select **Blank Template**. 1. Select either the **Code Editor** or **Design Editor**. 1. If you’re using the **Design Editor**, navigate to **Build**, select **Advanced** and then click **Import Drag & Drop HTML**. If you’re using the **Code Editor**, paste in the HTML. 1. Paste the HTML you copied from the downloaded file into the code editor and then click **Save** if you are using the **Code Editor** and **Update** and then **Save** if you are using the **Design Editor** . <call-out> Called Campaigns in legacy Newsletter, Single Sends is the new name for one-time, targeted marketing emails. </call-out> ### Images Exporting images from your library is a manual process at this time, so we recommend only following the steps below for images that you don’t have saved elsewhere. For images you want to download from legacy Marketing Campaigns, you’ll start by accessing your image library. Start by navigating to the editor either from Templates or from a draft campaign. Select your editor of choice, then follow the instructions below: **Design Editor:** _To export your images_: 1. From the **Design Editor**,Open the **Build** tab, then select **Add Modules** and drag an image module into your content. 1. Find an image you’d like to export and select it. This will open the Image Details tab. 1. Copy the Image Source URL and paste it into a browser window, then right click on the image to save it locally to your computer. You can then upload the image you’d like to add to your new draft by following [these steps]({{root_url}}/ui/sending-email/editor/#uploading-images). **Code Editor:** _To export your images_: 1. From the **Code Editor**, click the image icon in the top right corner of the code window to pull up the image library. 1. Find an image you’d like to export, and then copy the Image Source URL and paste it into a browser window. 1. Right click on the image to save it locally to your computer. 1. You can then upload the image you’d like to add to your new draft by following [these steps]({{root_url}}/ui/sending-email/editor/#adding-images). ## Update API Keys and Teammates As a separate product, you'll need to add permissions for new Marketing Campaigns to any API Keys or Teammates who you'd like to have access to new Marketing Campaigns. ### API Keys 1. Click on **Settings** in the lefthand navigation, and then **API Keys**. 1. Select the API key (or keys) that you'd like to add Marketing permissions to. 1. Click the action menu and select Edit API Key. 1. Select the **Marketing** dropdown and enable the **Marketing** and/or **Automation** toggles, granting permission. 1. Click Update to save your changes. ### Teammates 1. Click on **Settings** in the lefthand navigation, and then **Teammates**. 1. Find the Teammate (or teammates) whom you'd like to give new Marketing Campaigns permissions to. 1. Click the action menu and select Edit. 1. If the radio button for "Invite as Admin" is selected, the Teammate already has access to new Marketing Campaigns. 1. If not, and to enable feature-specific access, including new Marketing Campaigns Single Sends and/or Automation, click "Invite as Restricted Access". 1. Select the **Marketing** dropdown and enable the **Marketing** and/or **Automation** toggles, granting permission. 1. Click Update to save your changes. ## Create notifications Notifications are not carried over from legacy to new Marketing Campaigns. Please designate which email addresses you’d like to be alerted to any new Marketing Campaigns activity such as CSV uploads, etc. 1. Navigate to **Notifications** in new Marketing Campaigns and then click **Add Email**. 1. Enter the name and email of the person or account who you want to receive any notification emails. 1. Click **Save**. The name and email will display on the **Notifications** page. ## Review Senders and Unsubscribe Groups Senders and Unsubscribe Groups are carried over from legacy Marketing Campaigns. You don’t need to make any changes, but now is a good opportunity to make any adjustments you’ve had in mind. ## Export data you wish to reference Data and statistics are not carried over from legacy to new Marketing Campaigns. You can choose to export and save data for your reference in the future. <call-out type="warning"> You will have access to legacy Marketing Campaigns for a period of time allowing you to reference past campaign creative and stats. However, you’ll need to delete your contacts from legacy Marketing Campaigns to avoid being charged for contact storage. </call-out> ### Campaign Stats _To download aggregate stats for a given campaign_: 1. Navigate to **Campaigns** in legacy Marketing Campaigns. 1. Select the campaign name you wish to export your data from. 1. Click **Export CSV** in the upper right corner. A CSV file containing your data will download to the folder specified on your computer. _To download a list of all contacts who opened or clicked links within your campaign_: 1. Navigate to **Campaigns** in legacy Marketing Campaigns. 1. Find the Campaign you wish to export your data from, and click the linked **Unique Opens** or **Unique Clicks** data. ![]({{root_url}}/img/unique-clicks-data.png) 3. Click **Export CSV** in the upper right corner. A CSV file containing your data will download to the folder specified on your computer. Once the CSV file has finished processing, a link to download the CSV will be sent to the email(s) you have set to receive notifications about new Marketing Campaigns activity. ### Contact Engagement History To download data about individual contacts, including when they were last sent an email, and when they last opened or clicked an email: 1. Navigate to **Contacts** in legacy Marketing Campaigns. 1. Find the list or segment of contacts you wish to export. 1. Hover over the action menu and select the **Export** icon. 1. Once the export is completed, a download link will be sent to the email(s) you have specified to receive [notifications]({{root_url}}/ui/account-and-settings/notifications/) about legacy Marketing Campaigns. ## Updating integrations to the new Marketing Campaigns APIs Like legacy Marketing Campaigns, the new Marketing Campaigns experience offers APIs so you can programmatically manage your marketing emails. Today, you can manage contacts and Single Sends, with additional APIs for Segmentation and Automation [coming soon]({{root_url}}/ui/sending-email/coming-soon-to-new-marketing-campaigns/). Take a look at the table below for links to the API reference pages for legacy and new Marketing Campaigns respectively. The third column describes the action required to update your integrations from legacy to new Marketing Campaigns ### Updating Campaign API integrations <table> <tr> <th><span style="font-weight:bold">Legacy Marketing Campaigns</span></th> <th><span style="font-weight:bold">New Marketing Campaigns</span></th> <th><span style="font-weight:bold">Action Required</span></th> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/create-a-campaign">Create a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/create-single-send">Create Single Send</a></td> <td><li>Update endpoint</li><br><li>New Marketing Campaigns requires template ID as opposed to explicitly defined HTML content</li><br><li>Duplication of past campaigns is possible with a 'source' query string</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/retrieve-all-campaigns">Retrieve all Campaigns</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/get-all-single-sends">Get All Single Sends</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/retrieve-a-single-campaign">Retrieve a single campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/get-single-sends-by-id">Get Single Send by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/delete-a-campaign">Delete a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/delete-single-sends-by-id">Delete Single Send by ID</a><br><br>NEW <a href="https://sendgrid.api-docs.io/v3.0/single-sends/bulk-delete-single-sends">Bulk Delete Single Sends</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/update-a-campaign">Update a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/update-single-send">Update Single Send</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/send-a-campaign">Send a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/schedule-campaign">Schedule Single Send</a></td> <td><li>Update endpoint and HTTP verb</li><br><li>To send immediately set "send_at" set to "now"</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/schedule-a-campaign">Schedule a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/schedule-campaign">Schedule Single Send</a></td> <td><li>Update endpoint</li><br><li>Send at time now in ISO 8601 as opposed to a UNIX timestamp</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/update-a-scheduled-campaign">Update a Scheduled Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/schedule-campaign">Schedule Single Send</a></td> <td><li>Update endpoint and HTTP verb</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/view-scheduled-time-of-a-campaign">View Scheduled Time of a Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/get-single-sends-by-id">Get Single Send by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/campaigns-api/unschedule-a-scheduled-campaign">Unschedule a Scheduled Campaign</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/single-sends/delete-single-send-schedule">Delete Single Send Schedule</a></td> <td><li>Update endpoint</li></td> </tr> </table> ### Updating Contacts API integrations <table> <tr> <th><span style="font-weight:bold">Legacy Marketing Campaigns</span></th> <th><span style="font-weight:bold">New Marketing Campaigns</span></th> <th><span style="font-weight:bold">Action Required</span></th> </tr> <tr> <td></td> <td><span style="font-weight:bold">Lists</span></td> <td></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/create-a-list">Create a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/create-list">Create List</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/retrieve-all-lists">Retrieve all Lists</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/get-all-lists">Get All Lists</a></td> <td><li>Update endpoints</li><br><li>'page_token' new method of pagination</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/delete-multiple-lists">Delete Multiple Lists</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/delete-a-list">Delete a List</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/retrieve-a-single-list">Retrieve a Single List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/get-a-list-by-id">Get a List by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/update-a-list">Update a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/update-list">Update List</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/delete-a-list">Delete a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/delete-a-list">Delete a List</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/retrieve-all-recipients-on-a-list">Retrieve all Recipients on a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-all-contacts">Get All Contacts</a></td> <td><li>Update endpoint<br><li>List(s) a contact is on returns in Get All Contacts call</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/add-a-single-recipient-to-a-list">Add a Single Recipient to a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/add-or-update-a-contact">Add or Update a Contact</a></td> <td><li>Update endpoint and HTTP verb<br><li>List ID(s) added in JSON payload</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/delete-a-single-recipient-from-a-single-list">Delete a Single Recipient from a Single List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/lists/remove-contacts-from-a-list">Remove Contacts from a List</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-lists/add-multiple-recipients-to-a-list">Add Multiple Recipients to a List</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/add-or-update-a-contact">Add or Update a Contact</a></td> <td><li>Update endpoint and HTTP verb</li><br><li>List ID(s) added in JSON payload</li></td> </tr> <tr> <td></td> <td><span style="font-weight:bold">Recipients</span></td> <td></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/add-recipients">Add Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/add-or-update-a-contact">Add or Update a Contact</a></td> <td><li>Update endpoint and HTTP verb</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/get-recipient-upload-status">Get Recipient Upload Status</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/import-contacts-status">Import Contact Status</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/update-recipient">Update Recipient</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/add-or-update-a-contact">Add or Update a Contact</a></td> <td><li>Update endpoint and HTTP verb</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/delete-recipients">Delete Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/delete-contacts">Delete Contacts</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/retrieve-recipients">Retrieve Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-all-contacts">Get All Contacts</a></td> <td><li>Update endpoint</li><br><li>'page_token' new method of pagination</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/retrieve-a-single-recipient">Retrieve a Single Recipient</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-a-contact-by-id">Get a Contact by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/delete-a-recipient">Delete a Recipient</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/delete-contacts">Delete Contacts</a></td> <td><li>Update endpoint</li><br><li>Contact ID passed in JSON payload</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/retrieve-the-lists-that-a-recipient-is-on">Retrieve the Lists that a Recipient is on</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-a-contact-by-id">Get a Contact by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/retrieve-the-count-of-billable-recipients">Retrieve the Count of billable Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-total-contact-count">Get Total Contact Count</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/retrieve-a-count-of-recipients">Retrieve a Count of Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/get-total-contact-count">Get Total Contact Count</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-recipients/Create_Search%20with%20conditions">Search Recipients</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts/search-contacts">Search Contacts</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td></td> <td><span style="font-weight:bold">Custom Fields</span></td> <td></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-custom-fields/create-a-custom-field">Create a Custom Field</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/custom-fields/create-custom-field-definition">Create Custom Field Definition</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-custom-fields/retrieve-all-custom-fields">Retrieve all Custom Fields</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/custom-fields/get-all-field-definitions">Get All Field Definitions</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-custom-fields/retrieve-a-custom-field">Retrieve a Custom Field</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/custom-fields/get-all-field-definitions">Get All Field Definitions</a><br><br>NEW <a href="https://sendgrid.api-docs.io/v3.0/custom-fields/update-custom-field-definition">Update Custom Field Definition</a><br></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-custom-fields/delete-a-custom-field">Delete a Custom Field</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/custom-fields/delete-custom-field-definition">Delete Custom Field Definition</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-custom-fields/retrieve-reserved-fields">Retrieve Reserved Fields</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/custom-fields/get-all-field-definitions">Get All Field Definitions</a></td> <td><li>Update endpoint</li><br><li>Reserved fields defined in array "reserved_fields"</li></td> </tr> <tr> <td></td> <td><span style="font-weight:bold">Segments</span></td> <td></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/create-a-segment">Create a Segment</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/segments/create-segment">Create Segment</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/retrieve-all-segments">Retrieve all Segments</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/segments/get-list-of-segments">Get List of Segments</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/retrieve-a-segment">Retrieve a Segment</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/segments/get-segment-by-id">Get Segment by ID</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/update-a-segment">Update a Segment</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/segments/update-segment">Update Segment</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/delete-a-segment">Delete a Segment</a></td> <td><a href="https://sendgrid.api-docs.io/v3.0/segments/delete-segment">Delete Segment</a></td> <td><li>Update endpoint</li></td> </tr> <tr> <td><a href="https://sendgrid.api-docs.io/v3.0/contacts-api-segments/retrieve-recipients-on-a-segment">Retrieve Recipients on a Segment</a></td> <td>Coming soon</td> <td><li>Update endpoint</li></td> </tr> </table> ## Using the APIs to migrate contacts and content to new Marketing Campaigns You can leverage the APIs to programmatically manage much of your migration to new Marketing Campaigns by following the guidance below. ### Contacts **Recreate Lists** Use the legacy Marketing Campaigns API call [Retrieve all Lists](https://sendgrid.api-docs.io/v3.0/contacts-api-lists/retrieve-all-lists) to determine the list names to recreate in the new Marketing Campaigns. Then, use new Marketing Campaigns API call [Create List](https://sendgrid.api-docs.io/v3.0/lists/create-list) in the new experience. The values this call returns, particularly `‘id’`, are necessary for the recipient migration API. **Recreate Custom Fields** Use the legacy Marketing Campaigns API call to [Retrieve all Custom Fields](https://sendgrid.api-docs.io/v3.0/contactdb/custom_field) to determine the custom field necessary to recreate in new Marketing Campaigns. Use new Marketing Campaigns API call to create [Custom Field](https://sendgrid.api-docs.io/v3.0/custom-fields/create-custom-field-definition) in the new Marketing Campaigns API. Pass in the corresponding `‘name’` and `‘field_type’` from the legacy Marketing Campaigns GET call. The values this call returns, particularly `‘id’`, are necessary for the recipient migration API. **Migrate Recipients** Use the legacy Marketing Campaigns API call to [Retrieve all Recipients](https://sendgrid.api-docs.io/v3.0/contactdb/recipients) to recreate in new Marketing Campaigns. We recommend using pagination and iterating through all of the pages until you receive a `404 ‘no pages’` error. You will receive a response to return all contacts. The values this call returns, particularly `‘id’`, will be necessary for the recipient migration API. Iterate through all the recipients to get lists this recipient is on. Store the list(s) you wish to add your recipients onto in the new Marketing Campaigns, otherwise, recipients will add onto `‘All Contacts’` by default. Custom Field values and list(s) a recipient is on uses this data and calls [add contacts](https://sendgrid.api-docs.io/v3.0/contacts/add-or-update-a-contact) to the new experience. It is important to note: 1. Custom Fields pass as an object with key value pairs as `{ “id_1” : “value_1”, “id_2” : “value_2” }` and **not** as the name of the new Marketing Campaigns Custom Field. 2. This call allows for batching of recipients. It is recommended to add at least 1,000 recipients per API request. 3. You can omit `‘list_ids’` if your recipient is not uploaded to any lists, as it is optional. ## FAQs **What happens if I choose not to migrate?** Nothing will happen to your legacy Marketing Campaigns account until the product is discontinued. At this time, no date has been set for the deprecation of Legacy Marketing Campaigns. **How long will legacy Marketing Campaigns be available?** At this time no date has been set for the deprecation of Legacy Marketing Campaigns. If and when this occurs, we will be sure to communicate this news well in advance to ensure you have time to plan accordingly. **Once I’ve switched to new Marketing Campaigns, can I go back to using legacy Marketing Campaigns?** Yes, you can choose to upload contacts to legacy Marketing Campaigns and keep using it until the product is deprecated. At this time, there is no planned date to deprecate legacy Marketing Campaigns. Note, if you did not use legacy Marketing Campaigns prior to the launch of new Marketing Campaigns, you’ll need to speak to Support to gain access. **What is the additional value of the new Marketing Campaigns vs. the legacy product?** Moving forward, all innovation for our marketing platform will happen on new Marketing Campaigns, so it’s important you migrate to see these benefits over time. In addition to offering faster performance, increased scale, and improved stability, the new Marketing Campaigns also offers net-new functionality. _Automation_ Create a recurring email or series of emails that send automatically whenever a contact joins a list. Choose when each email sends, and whether a contact should exit the automation if they no longer meet the entry criteria. [Learn More]({{root_url}}/ui/sending-email/getting-started-with-automation/). _Email Testing_ Have confidence your emails are flawless with integrated email testing. See how emails render across the inboxes, browsers, and device types that matter to your business, ensure links within your email are valid and know how your email will perform against the most powerful spam filters. [Learn more]({{root_url}}/ui/sending-email/email-testing/). _Signup Forms_ Capture new signups and add them directly to your new Marketing Campaigns contacts. These forms can be embedded directly on your website or shared via a Twilio SendGrid-hosted URL. [Learn more]({{root_url}}/ui/managing-contacts/create-and-manage-contacts/#create-a-signup-form). _Familiar features and functionality from legacy_ These new features build on the functionality you’re used to in legacy Marketing Campaigns. This means after a few simple migration steps, you’ll be up and running quickly thanks to familiar workflows you already know. **Can I try the new Marketing Campaigns for free?** Yes! By default, you have access to the new Marketing Campaigns Free package in your account. It gives you access to all features, including Automation, so you can test fully. If you do not see the new Marketing Campaigns in your account, please contact support as you may need to make a change to your account due to an outdated plan type. **What happens to my legacy Marketing Campaigns account if I try new Marketing Campaigns?** There is no impact to your legacy Marketing Campaigns account by testing or upgrading to new Marketing Campaigns. When you upgrade to either the new Basic or Advanced package, you’ll be given a grace period to support your migration from legacy to new Marketing Campaigns. During this time, you will not be charged for contact storage in legacy Marketing Campaigns. Once the grace period has ended, you’ll be charged for any contacts over the free allotment of 2,000 in your legacy Marketing Campaigns storage. **I don’t see the new Marketing Campaigns in my account. What should I do?** If you do not see the new Marketing Campaigns in your account, please contact support to troubleshoot why you do not have access. **I have more than 200,000 contacts. What should I do?** To purchase a new Marketing Campaigns package above the Advanced 200K plan, please [contact our sales team](https://sendgrid.com/contact-us-form/). **Are there services to help me with migration?** Yes. There is a paid service where our experts will help get you quickly and successfully migrated to the new Marketing Campaigns. They’ll review your email marketing program, provide migration support, and teach you what you need to know to hit the ground running with the new Marketing Campaigns. [Learn more about this migration service](https://go.sendgrid.com/Marketing-Campaigns-Launch.html). **I have dedicated IP(s) I’ve already warmed up. What happens to them?** No changes will be made to your existing dedicated IPs unless you lose access by downgrading your Email API plan to Essentials or Free. If you choose an Advanced Marketing Campaigns plan, you’ll be granted a new, additional dedicated IP address. This will need to be [warmed up]({{root_url}}/ui/sending-email/ip-warmup-for-the-new-marketing-campaigns-experience/) to ensure a positive sender reputation. Email that you send from new Marketing Campaigns will be sent across all dedicated IPs you have for your account or subuser. You can choose to assign specific IPs to individual [subusers]({{root_url}}/ui/account-and-settings/subusers/#adding-subusers-to-dedicated-ip-addresses) to segment your sending across specific IP addresses. ================================================ FILE: content/docs/ui/sending-email/migrating-from-legacy-templates.md ================================================ --- layout: page weight: 90 group: transactional-email title: Migrating from Legacy Transactional Templates navigation: show: true seo: title: Migrating from Legacy Transactional Templates override: true description: Migrating from legacy transactional templates to dynamic transactional templates utilizing handlebars syntax. keywords: transactional email templates, email template, dynamic content, personalization, handlebars --- If you have transactional templates you want to use with handlebars syntax, you need to migrate your legacy templates to the new dynamic templates page. <call-out> The original template you copy won't be modified and remains active in any API or SMTP calls. To use the new template, update the template ID parameter in your code. </call-out> *To convert a legacy transactional template:* 1. Navigate to the [legacy templates](https://sendgrid.com/templates) page. 1. Create a version of the template you wish to migrate or select the actions menu on the template version and select **Edit**. The template opens in the editor and a green banner appears at the top of the page specifying that the template you are editing is a legacy template. 1. Select **Copy as New Template**. 1. Give the template a new name and click **Copy as New Template**. 1. Once the template is successfully copied over, click **Continue**. The template opens in the editor and you are prompted to replace any existing substitution tags with handlebars syntax. 1. To replace any existing substitution tags, click **Replace your substitution tags**. 1. Enter the opening and closing characters of your substitution tags and click **Replace**. 1. The module replaces all of the substitution tags in your template with handlebars. For example,{{your_tag_here}}. ## Additional resources - [How to send an email with dynamic transactional templates]({{root_url}}/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/) - [Using handlebars]({{root_url}}/ui/sending-email/using-handlebars/) - [Mail send with dynamic transactional templates](https://sendgrid.api-docs.io/v3.0/transactional-templates/) ================================================ FILE: content/docs/ui/sending-email/old-editor-sunset.md ================================================ --- layout: page weight: 11 group: building-email title: Old Editor Sunset navigation: show: false seo: title: Marketing Campaigns - Old Editor Sunset override: true description: On 16 April 2018, the old Marketing Campaigns editor is going away. --- <call-out type="warning"> On 16 April 2018, SendGrid will be discontinuing the old Marketing Campaigns editor. At that time, all campaigns will be opened and edited in the powerful new Marketing Campaigns experience. Some maintenance may be required when moving an old campaign in the new editor for the first time. We strongly encourage you to move any remaining campaigns into the new editor by 16 April, 2018 to ensure your sending is not interrupted when the deprecation occurs. </call-out> ## Additional Details ### Why is the old editor going away? Marketing Campaigns was built to empower Marketers to send beautiful messages that recipients love. In August 2017, SendGrid announced a [new, updated editing experience for Marketing Campaigns]({{root_url}}/ui/sending-email/editor/). The new experience was built on the success of the old editor and is focused on supporting your unique worflow. Since August, thousands of users have discovered the power, flexibility, and speed of the new editors. The new Marketing Campaigns editors offer a markedly better experience for crafting email campaigns. They feature increased stability, more powerful features, and a streamlined, flexible workflow that saves time. With the vast majority of users already taking advantage of the new experience, our team is dedicated to investing fully in the new Marketing Campaigns editors going forward. ### How do I know if I'm using the old or new editor? It’s likely that you’re already using the new Marketing Campaigns editing experience. Since August 2017, the only way to still access the old editor has been to duplicate a campaign that was originally created in that editor. If you’re using the old editor, you will notice a bar at the top of the screen that tells you that you’re in the old experience. ### I am still using the old editor. What do I need to do? Until 16 April 2018, if you duplicate a campaign that was originally created within the old editor, you will notice an alert banner at the top of the app. You can click the button within the alert to begin moving your campaign into the new editing experience. On 16 April 2018, if you duplicate a campaign that was originally created within the old editor, it will require you to open the campaign in one of the [new editors]({{root_url}}/ui/sending-email/editor/). While many campaigns will move over seamlessly, it’s possible that – depending how you’ve edited your campaign in the past – you’ll need to make a few tweaks or take a few moments to rebuild a template in the new editor. Rest assured, creating templates in the new editor is quick and easy – in most cases, taking only a few minutes. That said, if you have any issues at all, our [support team is available](https://support.sendgrid.com/)! ### I use both Design and Code. Why do I need to choose one? Good news! If you like to build your campaigns visually, but like to roll up your sleeves to edit some code to make it perfect, the Design Editor will a great option for you. While it's called the "Design Editor," this experience still features a number ways to access and edit HTML. Each visual drag and drop module in the new builder features one-click access to your HTML content. To access, click the action menu at the top of the blue bar in each drag-and-drop module and then select the `< >` icon to get to your code. Learn more about the [new editing experience]({{root_url}}/ui/sending-email/editor/). <call-out> If you’ve edited code in your current template but want to use it with the new visual, drag and drop editor, you will need to add our [Drag-&-Drop Markup]({{root_url}}/ui/sending-email/editor/#importing-custom-html-with-drag--drop-markup). </call-out> ### I moved my campaign to the new editor, but something looks weird. Depending on how you created and edited your campaign in the old experience, some maintenance may be required when moving an old campaign in a new editor for the first time. This is due to some improvements that we made with the new experience – particularly around how HTML is handled and protected. While these improvements offer far greater stability and speed for the long term, we know that these initial changes can be a bit frustrating. To help, we've identified 2 possible scenarios when migrating a campaign into the new editor, with some details on how to resolve these issues, below: **I have a custom coded template, but want to use the Design Editor:** <br>If you get custom code from your designer or developer and want to use it with our powerful new drag-and-drop Design editor, you can! First, our Design editor needs to be able to understand what kind of content blocks are in your email, and how it should group your content. To do this, you (or your developer) will need to add some of our [Drag and Drop Markup]({{root_url}}/ui/sending-email/editor/#importing-custom-html-with-drag--drop-markup) to the code. **When I opened the new editor, my entire email got dropped into one big code module:** <br>If you created a campaign using drag-and-drop modules in the old editor, but then edited some of the code yourself, this can cause the Design editor to view your email as a single block of code. If this is the case, we recommend that you take a few minutes to rebuild the campaign in the new drag-and-drop editor. This will ensure that your campaigns are stable, clean, and any bugs from the old editor aren't copied over into the new experience. ## We're here to help We're excited for all of the new value that you're going to experience with the new editor. As always, if you have any questions or concern, our [Support team](https://support.sendgrid.com) is standing by to help. ================================================ FILE: content/docs/ui/sending-email/recipient-subscription-preferences.md ================================================ --- layout: page weight: 0 title: Recipient Subscription Preferences group: tracking seo: title: Recipient Subscription Preferences description: When your users unsubscribe they will see a very specific page where they can manage their subscriptions with your emails. keywords: unsubscribe page, suppression page, recipient unsubscribe navigation: show: true --- Emails that are sent with an unsubscribe group specified will have 2 links at the bottom of the email: an “Email Preferences” link and an “Unsubscribe” link. If you do not specify an unsubscribe group when sending an email, the unsubscribe link will act as a global unsubscribe. This means that the recipient will no longer get any emails at all, including potentially important emails like password resets. To avoid this, create unsubscribe groups. ## The unsubscribe link When a recipient clicks the Unsubscribe link, they will be asked to confirm their choice and then will be added to the Global Unsubscribe list. ## The email preferences link If you choose not to use substitution tags, your emails will automatically have an Email Preferences link, which when clicked will show recipients their personalized Email Preferences page. From here, recipients will be able to see all of your Unsubscribe Groups and their descriptions. They will then be able to choose whether or not they want to receive those types of emails. ### Manage email preferences You can also choose to manually add the `<%asm_preferences_url%>` tag to your email. We will automatically replace that tag with the text "Manage Email Preferences" wherever the tag is found in your email. This will allow your recipients to see your Unsubscribe Groups in a Subscription Preference page and then choose which groups they are interested in. Alternatively, you can use the `<%asm_preferences_raw_url%>` substitution tag. This will be replaced with just the URL pointing to your Subscription Preference page without the hyperlinked text "Manage Email Preferences". For more substitution tags, please see our [transactional templates]({{root_url}}/ui/sending-email/create-and-edit-transactional-templates/#adding-unsubscribe-links-to-a-template). ## Additional resources - [Spam reports]({{root_url}}/ui/analytics-and-reporting/spam-reports/) ================================================ FILE: content/docs/ui/sending-email/sender-verification.md ================================================ --- layout: page title: Single Sender Verification group: sending-email navigation: show: false seo: title: Single Sender Verification override: true description: Understanding the difference between Domain Authentication and verifying a Single Sender. --- To protect your sending reputation and to uphold legitimate sending behavior, we require customers to verify their Sender Identities. This article will walk you through all the necessary steps to verify a Single Sender, one of two methods of verifying a [Sender Identity]({{root_url}}/for-developers/sending-email/sender-identity/). ### Adding a Sender 1. Under Settings in the navigation bar, click **Sender Authentication**. 2. Proceed with **Single Sender Verification** by selecting **Get Started** under **Verify an Address**. ![Sender Auth Page]({{root_url}}/img/sender-verification-sender-auth-page.png 'Sender Auth Page') 3. You will be taken to the **Single Sender Verification** page. Under **Create your First Sender**, click **Create New Sender** to load a form modal. ![Sender Management]({{root_url}}/img/sender-verification-sender-management-page.png 'Sender Management') ![Create New Sender]({{root_url}}/img/sender-verification-form-modal.png 'Create New Sender') 4. Fill in all of the fields in the form modal and then click **Create**. #### Form Fields - **From Name** - This is a user-friendly name that is displayed to your recipient when they receive their email. - **From Email Address** - This will display to the user as the email address that sent this email. We will send the verification email to the address you enter in this field. If you have not received your verification email after some time, please refer back to the Sender settings and confirm that the "From" email is a valid address. - **Reply To** - If your user hits reply in their email, the reply will go to this address. - **Company Address**, **City**, **State**, **Zip Code**, **Country** - Your business address. - **Nickname** - A label for your sender identity to help you identify it more quickly. This label is not visible to your recipients. <call-out> When filling the "From Email Address" field, you may notice a warning when entering an address at `yahoo.com`, `aol.com`, `gmail.com`, and some other domains. This warning indicates you should not use the address as your verified Single Sender because your messages will likely fail a DMARC check. For more details, see our comprehensive [DMARC page]({{root_url}}/ui/sending-email/dmarc/). </call-out> 5. Check the inbox of the email address that you entered and click the link in the email to verify the Sender address. If, for any reason, you need to resend the verification email, click the action menu on the **Single Sender Verification** page and select **Resend Verification**. We will deliver a new confirmation email to the address you are attempting to verify. ![Resend Verification]({{root_url}}/img/sender-verification-resend-verification.png 'Resend Verification') <call-out> If you have an [authenticated domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) and your sender email address matches that domain exactly, your sender identity will be verified automatically. </call-out> You will now see a page confirming the verification of your address. Click **Return to Single Sender Verification** to add more addresses or make any changes to the address you just verified. Congratulations, you are now ready to send email with SendGrid. ![Sender Verified]({{root_url}}/img/sender-verification-sender-verified-page.png 'Sender Verified') ================================================ FILE: content/docs/ui/sending-email/senders.md ================================================ --- layout: page weight: 70 title: Senders group: marketing-campaigns navigation: show: true seo: title: Senders override: true description: Manage your sender contact information --- <iframe src="https://player.vimeo.com/video/366851411" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> ## Adding a Sender You are required to include your contact information, including a physical mailing address, inside every promotional email you send in order to comply with the U.S. CAN-SPAM Act, CASL, and other anti-spam laws of the countries your recipients live in. *To add a Sender:* 1. Navigate to **Marketing** and then click **Senders**. 1. In the top right corner of the Sender Management page, click **Create New Sender**. 1. Fill in all of the fields on the page and then click **Save**. * **From Name** - This is a user-friendly name that is displayed to your recipient when they receive their email. * **From Email Address** - This will display to the user as the email address who sent this email. We will send the verification email to the address you enter in this field. If you have not received your verification email after some time, please refer back to the Sender settings and confirm that the "From" email is a valid address. * **Reply To** - If your user hits reply in their email, the reply will go to this address. * **Company Address, City, State, Zip Code, Country** - The address of your business. CAN-SPAM regulations require this information in every email you send. * **Nickname** - A label for your sender identity to help you identify it more quickly. This is not visible to your recipients. <br></br> 1. Check the inbox of the email address that you entered and click the link in the email to verify the Sender email. If, for any reason, you need to resend the verification email, click the action menu on the Sender Management page and select **Resend Verification**. ![]({{root_url}}/img/email-validation-clicking.gif "Clicking on the action menu and then selecting Resend Verification") <call-out type="warning"> You must verify the email address associated with your sender identity before you can edit it or use it to schedule a Single Send or set an Automation. </call-out> <call-out> You may create up to 100 unique senders. </call-out> <call-out> If you have an [authenticated domain]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) and your sender email address matches that domain exactly, your sender identity will be automatically verified. </call-out> <call-out type="warning"> Once you schedule a Single Send or set an Automation, you cannot delete the sender identity associated with the Single Send or Automation. </call-out> <call-out-link linktext="IMPLEMENTATION SERVICES" img="/img/expert-insights-promo1.png" link="https://sendgrid.com/solutions/email-implementation/"> ### Do you want expert help to get your email program started on the right foot? Save time and feel confident you are set up for long-term success with Email Implementation. Our experts will work as an extension of your team to ensure your email program is correctly set up and delivering value for your business. </call-out-link> ## Adding Sender Information to a Single Send or Automation Email Twilio SendGrid’s pre-built email templates come with an Unsubscribe module containing your Sender information by default. For templates or emails that you build yourself, you can insert your sender identity information into your campaigns using the following tags within your campaign or template content: 1. **{{sender_name}}** - The sender's name. 1. **{{sender_address}}** - The sender's street address. 1. **{{sender_city}}** - The sender's city. 1. **{{sender_state}}** - The sender's state. 1. **{{sender_zip}}** - The sender's zip. 1. **{{sender_country}}** - The sender's country. *To add tags to your email:* 1. In the Design editor, navigate to the **Build** tab and drag a Text module into your campaign body. If you’re using the Code Editor, click the gear icon on the left to open the **Settings** bar. 1. Navigate to the **Tags** tab. 1. Select the copy icon next to the tag you want to add to your campaign. 1. Paste the tag into your text module. To show your sender's full address and information in the footer of the email, Twilio SendGrid recommends adding the tags as shown: ``` {{Sender_Name}} {{Sender_Address}} {{Sender_City}} {{Sender_State} {{Sender_Zip}} ``` When successfully completed, your tags should change as shown below when your email enters your recipient’s mailbox. ![]({{root_url}}/img/sender-tag-comparison.png "Alt text") ## Additional Resources - [How to set up domain authentication]({{root_url}}/ui/account-and-settings/how-to-set-up-domain-authentication/) - [Troubleshooting Sender Authentication]({{root_url}}/ui/account-and-settings/troubleshooting-sender-authentication/) - [Custom Fields]({{root_url}}/ui/managing-contacts/custom-fields/) ================================================ FILE: content/docs/ui/sending-email/single-sends.md ================================================ --- layout: page weight: 85 title: Single Sends group: managing-contacts navigation: show: true seo: title: Single Sends override: true description: Exclude contacts from a Single Send based on list or segment membership. --- A Single Send is a one-time non-automated email message delivered to a list or segment of your audience. You can schedule a Single Send or send it immediately. Unlike an [Automation]({{root_url}}/glossary/automated-email/), a Single Send is not part of a series of related messages that are designed to work in sequence. Single Sends can be used to deliver promotional offers, engagement campaigns, newsletters, announcements, legal notices, policy updates, and more. ## Single Send features ### Design and Code Editors Twilio SendGrid Single Sends leverage our Design and Code Editors, allowing you to create templates quickly and easily without sacrificing the ability to customize your designs. Twilio SendGrid also provides a library of pre-built designs that you can duplicate and modify. See our dedicated [Design and Code Editor page]({{root_url}}/ui/sending-email/editor/) for more on working with email designs. ### Search and filter your Single Sends After creating multiple Single Sends, you can modify and delete them as needed. To make managing multiple Single Sends easier, Twilio SendGrid offers search functionality, enabling you to find a Single Send quickly by name. You can also filter your search results by status — "Draft," "Scheduled," or "Triggered" — and any categories you have added to your Single Sends. When filtering by multiple categories, Marketing Campaigns will return results matching any of the categories specified. For example, if you filter by the categories "Newsletter," "Promotion," and "BOGO," Marketing Campaigns will return Single Sends matching one _or_ more of those categories. ### A/B Testing A/B testing, also known as split testing, is a powerful way to optimize engagement with your email. A/B tests allow you to create multiple versions of a Single Send and deliver each to a subset of your audience. Based on the performance of each variant, a _winner_ is selected that can be sent to the rest of your contacts. When working with A/B tests, you can * Clone variations of A/B tests * Delete variations of A/B tests * Manually select the winner of an A/B test See our dedicated [A/B Testing page]({{root_url}}/ui/sending-email/a-b-testing/) to learn how to create and manage your A/B tests. ### Exclude lists and segments You can exclude up to 5 segments and 50 lists from a Single Send. Twilio SendGrid will omit any contacts who are on one of your excluded segments or lists from the send. ### Send tests Single Sends are integrated with Twilio SendGrid's Email Testing feature. Email Testing allows you to check not only whether or not your messages will be rendered properly across mail clients but also how likely a message is to perform well across spam filters. For more about testing, see our dedicated [Email Testing page]({{root_url}}/ui/sending-email/email-testing/). ### The Single Sends API For those who want to manage their Single Sends programmatically, Twilio SendGrid provides the [Single Sends API]({{root_url}}/api-reference/). ## Work with Single Sends ### Create a Single Send _To create a new Single Send_ 1. From the left-hand navigation, select **Marketing**. 2. Select **Single Sends** and click **Create Single Send**. 3. Select a template from **Your Email Designs** or one of the pre-built **SendGrid Email Designs**. <br> For more information about our designs, see [Working with Marketing Campaigns Email Designs]({{root_url}}/ui/sending-email/working-with-marketing-campaigns-email-designs/). <call-out> You can also create a template from an existing Single Send by selecting the action menu next to the email you'd like to reuse and selecting **Create Template**. </call-out> 4. Select an editor. You can choose between the **Design Editor** and the **Code Editor**. - Inside the Design Editor, the **Settings**, **Tags** and **Build** tabs allow you to design and configure your email. - Inside the Code Editor, you can click the left **Settings** tab to expand the settings window, and then you can configure your email using the **Settings** and **Tags** tabs. ![]({{root_url}}/img/design-editor-preview.png 'Design Editor Preview') 5. Click **Save**. Your Single Send is now created. Next, you will need to edit the Single Send's settings. ### Single Send required settings The **Settings** tab allows you to configure all the essential information about your Single Send, including the sender and recipients. To completely prepare a Single Send's settings, you must define the following fields. - **From Sender**: The publicly visible sender of your Single Send. This email address should be one of your verified senders. See our [sender verification documenation]({{root_url}}/ui/sending-email/sender-verification/) for more information about setting up a verified sender. - **Email Subject**: The email's subject line. This field can be A/B tested. - **Recipients**: The segments or lists you want to send the email to. <call-out type="warning"> There is a limit of 10 segments per Single Send. See our [segmentation documentation]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/) for more information about managing your contacts and building Single Sends based on engagement data. </call-out> - **Scheduling**: A Single Send can be sent immediately or scheduled in advance. If you select **Specify a Date and Time**, **Date** and **Time** fields will be displayed where you can set a future send time. ### Single Send optional settings In addition to the settings necessary to send your messages, Single Sends provide optional settings that allow you to more precisely manage how you target your audience with each message. #### Exclude contacts from a Single Send _To exclude a segment or list from your Single Send_ 1. Navigate to **Marketing** and select **Single Sends**. 2. Create a new Single Send or open existing Single Send. 3. Once the Single Send is open, in the **Settings** tab scroll to the **Recipients** header. 4. Toggle **Exclude specific recipients** to **ON**. 5. This will display an **Exclude** drop-down menu. 6. The drop-down menu will load all of your **Lists** and **Segments**. Select any lists or segments you wish to exclude from the Single Send. <br /> You can include as many as 5 segments and 50 lists. ![Exclude recipients from a Single Send]({{root_url}}/img/single-sends-exclude-recipients.png 'Exclude recipients') The contacts associated with your selected lists or segments will be excluded from the Single Send. #### Send from a specific IP Pool If you have dedicated IPs, you can set up [IP Pools]({{root_url}}/ui/account-and-settings/ip-pools/) that allow you to separate your traffic and potentially enhance your deliverability by protecting your sender reputation. _To utilize IP pools for Single Sends_ 1. navigate to **Settings** and from the IP Pool drop-down and select the IP pool you wish to use. ### Single Sends additional tabs For more thorough information about working with the other tabs used to configure a Single Send, please visit the dedicated documentation for each tab listed below. * [Design and Code Editor documentation]({{root_url}}/ui/sending-email/editor/). * [Tags]({{root_url}}/ui/sending-email/editor/#substitution-tags). * [A/B Testing](/{{root_url}}/ui/sending-email/a-b-testing/) ================================================ FILE: content/docs/ui/sending-email/spam-traps.md ================================================ --- seo: title: Spam Trapped canonical: https://sendgrid.com/blog/spam-traps-what-they-are-and-why-you-should-pay-attention-to-them/ description: Spam Trapped keywords: spam, role, address, trap, honey, pot, double, segmentation, opt-in, bad, old, spam traps, purchased, lists title: Spam Trapped group: tracking weight: 0 layout: page zendesk_id: 200182968 navigation: show: true --- **What Spam Traps Are & Why You Should Pay Attention To Them** : Spam Traps are simply ways to identify and monitor spam. Creating them is as easy as taking an email address or even an entire domain that hasn’t been subscribed to any emails and sending an email to it. Since they haven’t subscribed to any mail, it will be considered spam. There are a wide variety of spam traps. Sources for spam traps are usually old addresses that were used as role addresses (sales@ info@ support@) in domain registrations or email addresses that were once valid but have been reassigned for trapping spam. This type of spam trap has once opted in to receive email and was likely published on a page somewhere online. (This is not that case for dictionary attackers since they generate millions of randomized addresses at common domains i.e. example@example.com, example@example.com and so on.) Spam traps are so important because so many large ISPs, spam filter providers and Domain Name System [deny lists]({{root_url}}/glossary/deny-list/) use them. In short, sending an email to a spam trap can lead directly to being blocked by the organization that set up the trap. Remember that blocks can ruin a business’s reputation and halt further email deliverability. <call-out-link linktext="EXPERT INSIGHTS" img="/img/expert-insights-promo2.png" link="https://sendgrid.com/solutions/expert-insights/"> ### Looking for more visibility into your email performance? Send better email with Expert Insights. Our detailed monthly reports will enable you to understand your email reputation and recipient engagement and repair issues with expert how-to steps. </call-out-link> **How a Spam Trap Ended Up on a List** : The first medium to avoid is **bad list sources**. This includes any list that has not opted in to receiving a company’s messages such as purchased lists. Avoid unsolicited lists to ensure a business’s reputability. Chances are (99.99%) there is a spam trap included in these lists. The second critical aspect to pay attention to is **list contamination**. List contamination is when an email address that is a spam trap was added deliberately or accidentally to an unconfirmed list. (This is a list with single opt-in or notified opt-in) To avoid list contamination make sure to check the correct spelling of the list’s email addresses and take advantage of double opt-in for every list. The last important tool in avoiding spam traps is the **age of the list**. Like previously mentioned, spam traps are sometimes sourced in outdated email addresses that are no longer valid. Going for long periods of time (over one year) without sending mail to an address can lead to getting caught in a spam trap. To prevent this type of spam trap, [clean out old addresses]({{root_url}}/ui/managing-contacts/managing-contact-list/). **How to Remove Spam Traps from Lists** : Removing a spam trap is tricky business not to mention time consuming. It is inefficient and expensive to throw out a whole list and one way to avoid this is [list segmentation]({{root_url}}/ui/managing-contacts/segmenting-your-contacts/). Identify clean list segments that are free of any possible spam traps. If an address has not opened any emails for over six months, it may be a spam trap and should be sent one last [confirmatory email]({{root_url}}/glossary/reconfirmation/). Clean list segments need not be sent a confirmatory email. Why not repermission the whole list? Because confirming every subscriber’s consent to receive emails isn’t ideal. Subscribers who want to continue to receive mail may not re-subscribe because they did not notice the email or just forgot to reconfirm. To escape the woes that come with list reconfirmation, remember to ensure thorough and routine list maintenance. This will save time, reputation, and a big headache. ================================================ FILE: content/docs/ui/sending-email/spam.md ================================================ --- seo: title: Google Feedback Loop (Spam Complaints) description: Google Feedback Loop (Spam Complaints) keywords: title: Google Feedback Loop (Spam Complaints) group: tracking weight: 0 layout: page zendesk_id: 202604713 navigation: show: true --- SendGrid does automatically suppress any spam complaint address reported through traditional feedback loops. However, some webmail providers, notably Gmail, do not provide a traditional feedback loop out of privacy concerns. Rather, they provide an anonymous, aggregate report directly to us about concerning senders. This matters to you because senders with high spam complaints will often see their mail broadly throttled or blocked during future email campaigns if this remains an unresolved issue. Since Gmail’s reporting is anonymous, you won’t know specifically who flagged your mail as spam, and you likely won’t know this is an issue until SendGrid reaches out to you. If you receive a report from us about Google spam complaints, or even from traditional feedback loops, we have a few best practices to help you resolve the issue: 1. If you don’t have opt-in, don’t send any more to those lists. It’s against our [Terms of Service](http://sendgrid.com/email_policy), and considered to be [spam](http://www.spamhaus.org/consumer/definition/) anyway by the email community. 2. If your list is opt-in, track who’s actually engaging with your email, as measured by click and open tracking. Many customer have this data in their own CRM, or you may prefer to use our own [Click](https://sendgrid.com/docs/ui/analytics-and-reporting/click-tracking-html-best-practices/) and [Open Tracking](https://sendgrid.com/docs/ui/account-and-settings/tracking/) apps, coupled with the [EventKit](https://sendgrid.com/docs/for-developers/tracking-events/event-kit/) to consume this data. For recipients who don’t engage with your email, after a certain period of time that you determine to be appropriate based on your customer base and business model, stop sending to them. This tends to be a period between a few weeks to 3 months, depending on your sending frequency. If you receive a report from us about spam complaints, use this as an opportunity to implement better list acquisition and maintenance. ================================================ FILE: content/docs/ui/sending-email/ssl-vs-tls.md ================================================ --- seo: title: SSL vs. TLS description: SSL vs. TLS keywords: title: SSL vs. TLS group: delivery-optimization weight: 0 layout: page navigation: show: true --- TLS (Transport Layer Security) and SSL (Secure Sockets Layer) are protocols that provide data encryption and authentication between applications and servers sending data across an insecure network, such as your email. The terms SSL and TLS are often used interchangeably or in conjunction with each other (TLS/SSL), but one is, in fact, the predecessor of the other — SSL 3.0 served as the basis for TLS 1.0 which, as a result, is sometimes referred to as SSL 3.1. With this said, _is there a practical difference between the two?_ People used to believe that TLS v1.0 was marginally more secure than SSL v3.0, its predecessor. However, SSL v3.0 is getting very old and recent developments, such as the [POODLE](https://en.wikipedia.org/wiki/POODLE) vulnerability, have shown that SSL v3.0 is now completely insecure (especially for websites using it). Even before the POODLE was set loose, the US Government had already mandated that SSL v3 not be used for sensitive government communications or for HIPAA-compliant communications. As a result of POODLE, SSL v3 is being disabled on websites all over the world and for many other services as well. SSL v3.0 is effectively “dead” as a useful security protocol. Places that still allow its use for web hosting are placing their “secure websites” at risk; organizations that allow the use of SSL v3 to persist for other protocols (for example, IMAP) should take steps to remove that support at the soonest software update maintenance window. Subsequent versions of TLS — v1.1 and v1.2 — are _significantly more secure_ and fix many vulnerabilities present in SSL v3.0 and TLS v1.0. The newer TLS versions, if properly configured, prevent attacks and provide many stronger ciphers and encryption methods. SendGrid supports TLS v1.1 and higher. **Should You Be Using SSL or TLS?** The IETF deprecated both SSL 2.0 and 3.0 (in 2011 and 2015, respectively). Over the years the deprecated SSL protocols continue to reveal vulnerabilities (for example, POODLE, DROWN). Most modern browsers show a degraded user experience (for example, a line through the padlock or https in the URL bar, or security warnings) when they encounter a web server using the old protocols. For these reasons, you should disable SSL 2.0 and 3.0 in your server configuration, leaving only TLS protocols enabled. **Certificates are not the same as protocols** Before anyone starts worrying that they need to replace their existing SSL Certificates with TLS Certificates, it’s important to note that certificates are not dependent on protocols. That is, you don’t need to use a TLS Certificate vs. an SSL Certificate. While many vendors tend to use the phrase “SSL/TLS Certificate”, it may be more accurate to call them “Certificates for use with SSL and TLS", since your server configuration determines the protocols, and not the certificates themselves. It’s likely you will continue to see certificates referred to as SSL Certificates because at this point that’s the term more people are familiar with, but we’re beginning to see increased usage of the term TLS across the industry. SSL/TLS is a common compromise until more people become familiar with TLS. **Are SSL and TLS Any Different Cryptographically?** In truth, the answer to this question is yes, but you can say the same about the historical versions of SSL 2 and 3 or the TLS versions 1 with 1.1, 1.2 or 1.3. SSL and TLS are both about the same protocol but because of the version differences, SSL 2 was not interoperable with version 3, and SSL version 3 not with TLS version 1. You could argue that Transport Layer Security (TLS) was just a new name for SSL v4 - essentially, we are talking about the same protocol. Each newly released version of the protocol came and will come with improvements and new or deprecated features. SSL version one was never released, version two did but had some significant flaws, SSL version 3 was a rewrite of version two (to fix these flaws) and TLS version 1 an improvement of SSL version 3. Since the release of TLS 1.0 the changes have been less significant, but never less important. It’s worth noting here that SSL and TLS simply refer to the handshake that takes place between a client and a server. The handshake doesn’t actually do any encryption itself, it just agrees on a shared secret and type of encryption that is going to be used. ## Additional Resources [Configuring ports with SendGrid]({{root_url}}/for-developers/sending-email/getting-started-smtp/) ================================================ FILE: content/docs/ui/sending-email/subscription-tracking.md ================================================ --- seo: title: Unsubscribe via Subscription Tracking description: Unsubscribe via Subscription Tracking keywords: subscription, page, landing, replacement, tag, text, unsubscribe, unsub, html, click_tracking, body, <% %> title: Unsubscribe via Subscription Tracking group: tracking weight: 0 layout: page zendesk_id: 200181498 navigation: show: true --- ## What does it do? - Automatically add an unsubscribe link to the bottom of your emails. - Customize the unsubscribe link that is added automatically - Create a replacement tag that will allow you to put the unsubscribe link anywhere you would like using HTML. - Automatically incorporates the [list-unsubscribe](https://sendgrid.com/blog/list-unsubscribe/) header in your emails. ## How do I enable Subscription Tracking? From your Account Overview page, visit the sidebar menu and click “Settings”. From there, select "Tracking". Locate the Subscription Tracking option and click on the arrow on the right side and click on the "Off/On" button. ![]({{root_url}}/images/unsub_tracking.gif) ## How do I just add an unsubscribe link? Just enable the setting! Once enabled, we'll add the default unsubscribe link to the bottom of your emails. ## How do I change what the link says? Assuming that you have the setting enabled already, go into the app’s settings. To add your own wording, edit the text within the “Unsubscribe Content” boxes. ### HTML Body Unsubscribe The first box to edit is for HTML formatted emails. Notice that the words “click here” are wrapped with a <% %> symbols. This tells our system to link the words within the symbols to the unsubscribe URL. These will be the words that will be “clickable” in order to unsubscribe. In this example, people will click "click here" in order to unsubscribe. ![]({{root_url}}/images/html_body_unsubscribe.png) ### Plain Text Unsubscribe Change the Plain Text content as well. There won’t be any clickable wording here though, since that is an HTML feature. The symbols <% %> will insert the unsubscribe URL. Users viewing the email in Plain Text will be able to click that URL in order to unsubscribe from your emails. ![]({{root_url}}/images/Screen_Shot_2015-05-26_at_11.38.37_AM.png) Note: It is important to have the <% %> symbols in the plain text body version in order for the links to be added. ## I don't want my unsubscribe links at the bottom! This requires adding a HTML code snippet to the body of your email using the Replacement Tag field within the Subscription app’s settings. Set a replacement tag within the replacement tag field. {i.e. [unsubscribe]} ![]({{root_url}}/images/Screen_Shot_2015-05-26_at_11.39.15_AM.png) Doing this will allow you to use that tag within the html. This tag will get replaced with the unsubscribe URL. So, to create your unsubscribe link, just use some simple HTML. ### For example: <p>If you would like to stop receiving these emails <a href=”[unsubscribe]”>click here</a></p> ## What is a landing page? This section allows you to create a page that appears once the unsubscribe link is clicked. So, once a recipient clicks the unsubscribe link, they will get redirected to this landing page you have created. ![]({{root_url}}/images/Screen_Shot_2015-05-26_at_11.39.02_AM.png) ================================================ FILE: content/docs/ui/sending-email/substitution-and-section-tags.md ================================================ --- seo: title: Substitution and Section Tags description: Substitution and Section Tags keywords: substitution, section title: Substitution and Section Tags group: building-email weight: 0 layout: page zendesk_id: 204382358 navigation: show: true --- ## Simple Name Substitution This example will show you how to create a name substitution for your emails. We will be using the tag `-name-` in this example. In this example, the tag `-name-` will get replaced with the name of the recipient. #### Email Content ``` Hello -name-, ``` #### HTML ```html <html> <head></head> <body> <p>Hello -name-,<br /></p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": ["john@domain.com", "jane@domain.com", "matt@domain.com"], "sub": { "-name-": ["John", "Jane", "Matt"] } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john@domain.com", "name": "John" } ], "subject": "Example 01", "substitutions": { "-name-": "John" } }, { "to": [ { "email": "jane@domain.com", "name": "Jane" } ], "subject": "Example 02", "substitutions": { "-name-": "Jane" } }, { "to": [ { "email": "matt@domain.com", "name": "Matt" } ], "subject": "Example 03", "substitutions": { "-name-": "Matt" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "Hello -name-," }, { "type": "text/html", "value": "Hello -name-," } ] } ``` #### Example Outcome: john@domain.com #### Text ``` Hello John, ``` #### HTML ```html <html> <head></head> <body> <p>Hello John,<br /></p> </body> </html> ``` #### Example Outcome: jane@domain.com #### Text ``` Hello Jane, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Jane,<br /></p> </body> </html> ``` #### Example Outcome: matt@domain.com #### Text ``` Hello Matt, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Matt,<br /></p> </body> </html> ``` ## First Name and Last Name Substitutions This example will show you how to create a first name and last name substitution for your emails. We will be using the tags `-first_name-` and `-last_name-` in this example. In this example the tag `-first_name-` will get replaced with the first name of the recipient and the tag `-last_name-` will get replaced with the last name of the recipient. #### Text ``` Hello -first_name- -last_name-, ``` #### HTML ```html <html> <head></head> <body> <p>Hello -first_name- -last_name-,<br /></p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": [ "john.smith@domain.com", "jane.williams@domain.com", "matt.johnson@domain.com" ], "sub": { "-first_name-": ["John", "Jane", "Matt"], "-last_name-": ["Smith", "Williams", "Johnson"] } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john.smith@domain.com", "name": "John Smith" } ], "subject": "Example 01", "substitutions": { "-first_name-": "John", "-last_name-": "Smith" } }, { "to": [ { "email": "jane.williams@domain.com", "name": "Jane Williams" } ], "subject": "Example 02", "substitutions": { "-first_name-": "Jane", "-last_name-": "Williams" } }, { "to": [ { "email": "matt.johnson@domain.com", "name": "Matt Johnson" } ], "subject": "Example 03", "substitutions": { "-first_name-": "Matt", "-last_name-": "Johnson" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "Hello -first_name- -last_name-," }, { "type": "text/html", "value": "Hello -first_name- -last_name-," } ] } ``` #### Example Outcome: john.smith@domain.com #### Text ``` Hello John Smith, ``` #### HTML ```html <html> <head></head> <body> <p>Hello John Smith,<br /></p> </body> </html> ``` #### Example Outcome: jane.williams@domain.com #### Text ``` Hello Jane Williams, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Jane Williams,<br /></p> </body> </html> ``` #### Example Outcome: matt.johnson@domain.com #### Text ``` Hello Matt Johnson, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Matt Johnson,<br /></p> </body> </html> ``` ## Simple Greeting Section with Name Substitution <call-out type="warning"> Due to low usage, the Section Tags feature has been deprecated. It will be fully removed on 06/22/2020. Click [here]({{root_url}}/ui/account-and-settings/retired-mail-settings/) for more information. </call-out> This example will show you how to create a section as a greeting with a name substitution. We will be using the tags `-warm_welcome-`, `-greeting-` and `-name-` in this example. In this example, we have created a greeting using the section tag `-warm_welcome-`. The `-warm_welcome-` tag is replaced with the `-greeting-` substitution which calls the section `"Hello -name-,"`. The `-name-` tag in `"Hello -name-,"` is then replaced with the recipient's name. #### Text ``` -warm_welcome- ``` #### HTML ```html <html> <head></head> <body> <p>-warm_welcome-<br /></p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": ["john@domain.com", "jane@domain.com", "matt@domain.com"], "sub": { "-name-": ["John", "Jane", "Matt"], "-warm_welcome-": ["-greeting-", "-greeting-", "-greeting-"] }, "section": { "-greeting-": "Hello -name-," } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john@domain.com", "name": "John" } ], "subject": "Example 01", "substitutions": { "-name-": "John", "-warm_welcome-": "-greeting-" } }, { "to": [ { "email": "jane@domain.com", "name": "Jane" } ], "subject": "Example 02", "substitutions": { "-name-": "Jane", "-warm_welcome-": "-greeting-" } }, { "to": [ { "email": "matt@domain.com", "name": "Matt" } ], "subject": "Example 03", "substitutions": { "-name-": "Matt", "-warm_welcome-": "-greeting-" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "-warm_welcome-" }, { "type": "text/html", "value": "<html>\n <head></head>\n <body>\n <p>-warm_welcome-<br>\n </p>\n </body>\n</html>" } ], "sections": { "-greeting-": "Welcome -name-," } } ``` #### Example Outcome: john@domain.com #### Text ``` Hello John, ``` #### HTML ```html <html> <head></head> <body> <p>Hello John,<br /></p> </body> </html> ``` #### Example Outcome: jane@domain.com #### Text ``` Hello Jane, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Jane,<br /></p> </body> </html> ``` #### Example Outcome: matt@domain.com #### Text ``` Hello Matt, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Matt,<br /></p> </body> </html> ``` ## Greeting Section with First & Last Name Substitutions This example will show you how to create a section with first name and last name substitution for your emails. We will be using the tags `-warm_welcome-`, `-greeting-`, `-first_name-` and `-last_name-` in this example. In this example, we have created a greeting using the section tag `-warm_welcome-`. The `-warm_welcome-` tag is replaced with the `-greeting-` substitution which calls the section `"Hello -first_name- -last_name-,"`. The `-first_name-` and `-last_name-` tags in `"Hello -first_name- -last_name-,"` is then replaced with the recipients first and last names. #### Text ``` -warm_welcome- ``` #### HTML ```html <html> <head></head> <body> <p>-warm_welcome-<br /></p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": [ "john.smith@domain.com", "jane.williams@domain.com", "matt.johnson@domain.com" ], "sub": { "-first_name-": ["John", "Jane", "Matt"], "-last_name-": ["Smith", "Williams", "Johnson"], "-warm_welcome-": ["-greeting-", "-greeting-", "-greeting-"] }, "section": { "-greeting-": "Hello -first_name- -last_name-," } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john.smith@domain.com", "name": "John Smith" } ], "subject": "Example 01", "substitutions": { "-first_name-": "John", "-last_name-": "Smith", "-warm_welcome-": "-greeting-" } }, { "to": [ { "email": "jane.williams@domain.com", "name": "Jane Williams" } ], "subject": "Example 02", "substitutions": { "-first_name-": "Jane", "-last_name-": "Williams", "-warm_welcome-": "-greeting-" } }, { "to": [ { "email": "matt.johnson@domain.com", "name": "Matt Johnson" } ], "subject": "Example 03", "substitutions": { "-first_name-": "Matt", "-last_name-": "Johnson", "-warm_welcome-": "-greeting-" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "-warm_welcome-" }, { "type": "text/html", "value": "<html>\n <head></head>\n <body>\n <p>-warm_welcome-<br>\n </p>\n </body>\n</html>" } ], "sections": { "-greeting-": "Welcome -first_name- -last_name-," } } ``` #### Example Outcome: john.smith@domain.com #### Text ``` Hello John Smith, ``` #### HTML ```html <html> <head></head> <body> <p>Hello John Smith,<br /></p> </body> </html> ``` #### Example Outcome: jane.williams@domain.com #### Text ``` Hello Jane Williams, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Jane Williams,<br /></p> </body> </html> ``` #### Example Outcome: matt.johnson@domain.com #### Text ``` Hello Matt Johnson, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Matt Johnson,<br /></p> </body> </html> ``` ## Three Different Greeting Sections with First & Last Name Substitutions This example will show you how to create three different sections, each with first name and last name substitution for your emails. We will be using the tags `-warm_welcome-`, `-greeting01-`, `-greeting02-`, `-greeting03-`, `-first_name-` and `-last_name-` in this example. In this example, we have created three different greetings using the section tag `-warm_welcome-`. The `-warm_welcome-` tag is replaced with either `-greeting01-`, `-greeting02-` or `-greeting03-` substitution. This will call one of the three sections. In each of these sections, there is the `-first_name-` and `-last_name-` tags which will get replaced with the recipients first and last names. #### Text ``` -warm_welcome- ``` #### HTML ```html <html> <head></head> <body> <p>-warm_welcome-<br /></p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": [ "john.smith@domain.com", "jane.williams@domain.com", "matt.johnson@domain.com" ], "sub": { "-first_name-": ["John", "Jane", "Matt"], "-last_name-": ["Smith", "Williams", "Johnson"], "-warm_welcome-": ["-greeting01-", "-greeting02-", "-greeting03-"] }, "section": { "-greeting01-": "Welcome -first_name- -last_name-,", "-greeting02-": "Hello -first_name- -last_name-,", "-greeting03-": "Dear -first_name- -last_name-," } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john.smith@domain.com", "name": "John Smith" } ], "subject": "Example 01", "substitutions": { "-first_name-": "John", "-last_name-": "Smith", "-warm_welcome-": "-greeting01-" } }, { "to": [ { "email": "jane.williams@domain.com", "name": "Jane Williams" } ], "subject": "Example 02", "substitutions": { "-first_name-": "Jane", "-last_name-": "Williams", "-warm_welcome-": "-greeting02-" } }, { "to": [ { "email": "matt.johnson@domain.com", "name": "Matt Johnson" } ], "subject": "Example 03", "substitutions": { "-first_name-": "Matt", "-last_name-": "Johnson", "-warm_welcome-": "-greeting03-" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "-warm_welcome-" }, { "type": "text/html", "value": "<html>\n <head></head>\n <body>\n <p>-warm_welcome-<br>\n </p>\n </body>\n</html>" } ], "sections": { "-greeting01-": "Welcome -first_name- -last_name-,", "-greeting02-": "Hello -first_name- -last_name-,", "-greeting03-": "Dear -first_name- -last_name-," } } ``` #### Example Outcome: john.smith@domain.com #### Text ``` Welcome John Smith, ``` #### HTML ```html <html> <head></head> <body> <p>Welcome John Smith,<br /></p> </body> </html> ``` #### Example Outcome: jane.williams@domain.com #### Text ``` Hello Jane Williams, ``` #### HTML ```html <html> <head></head> <body> <p>Hello Jane Williams,<br /></p> </body> </html> ``` #### Example Outcome: matt.johnson@domain.com #### Text ``` Dear Matt Johnson, ``` #### HTML ```html <html> <head></head> <body> <p>Dear Matt Johnson,<br /></p> </body> </html> ``` ## Three Confirmation Sections and Substitutions This example will show you how to create three different sections for confirmation emails. We will be using the tags `-name-`, `-confirmations-`, `-confirmation_001-`, `-confirmation_002-`, `-confirmation_003-` and `-order_id-` in this example. In this example, we have created three different confirmations using the section tag `-confirmations-`. The `-confirmations-` tag is replaced with either `-confirmation_001-`, `-confirmation_002-` or `-confirmation_003-` substitution. This will call one of the three sections. In each of these sections, there is the `-order_id-` tag which will get replaced with the recipient's order id. #### Text ``` Hello -name-, -confirmations- ``` #### HTML ```html <html> <head></head> <body> <p> Hello -name-,<br /> -confirmations- </p> </body> </html> ``` #### X-SMTPAPI Header ```json { "to": ["john@domain.com", "jane@domain.com", "matt@domain.com"], "sub": { "-name-": ["John", "Jane", "Matt"], "-confirmations-": [ "-confirmation_001-", "-confirmation_002-", "-confirmation_003-" ], "-order_id-": ["12345", "23456", "34567"] }, "section": { "-confirmation_001-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-.", "-confirmation_002-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-. This invoice is to be paid by bank transfer within 7 days from the date of your monthly statement.", "-confirmation_003-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-. You can download your invoice as a PDF for your records." } } ``` #### v3 Mail Send ```json { "personalizations": [ { "to": [ { "email": "john@domain.com", "name": "John" } ], "subject": "Example 01", "substitutions": { "-name-": "John", "-order_id-": "12345", "-confirmations-": "-confirmation_001-" } }, { "to": [ { "email": "jane@domain.com", "name": "Jane" } ], "subject": "Example 02", "substitutions": { "-name-": "Jane", "-order_id-": "23456", "-confirmations-": "-confirmation_002-" } }, { "to": [ { "email": "matt@domain.com", "name": "Matt" } ], "subject": "Example 03", "substitutions": { "-name-": "Matt", "-order_id-": "34567", "-confirmations-": "-confirmation_003-" } } ], "from": { "email": "sender@senddomain.com", "name": "Sender" }, "reply_to": { "email": "sender@senddomain.com", "name": "Sender" }, "subject": "Example", "content": [ { "type": "text/plain", "value": "Hello -name-,\n-confirmations-" }, { "type": "text/html", "value": "<html>\n <head></head>\n <body>\n <p>Hello -name-,<br>\n -confirmations-</p>\n </body>\n</html>" } ], "sections": { "-confirmation_001-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-.", "-confirmation_002-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-. This invoice is to be paid by bank transfer within 7 days from the date of your monthly statement.", "-confirmation_003-": "Thanks for choosing SendGrid. This email is to confirm that we have processed your order -order_id-. You can download your invoice as a PDF for your records." } } ``` #### Example Outcome: john@domain.com #### Text ``` Welcome John, Thanks for choosing SendGrid. This email is to confirm that we have processed your order 12345. ``` #### HTML ```html <html> <head></head> <body> <p> Welcome John,<br /> Thanks for choosing SendGrid. This email is to confirm that we have processed your order 12345. </p> </body> </html> ``` #### Example Outcome: jane@domain.com #### Text ``` Hello Jane, Thanks for choosing SendGrid. This email is to confirm that we have processed your order 23456. This invoice is to be paid by bank transfer within 7 days from the date of your monthly statement. ``` #### HTML ```html <html> <head></head> <body> <p> Hello Jane,<br /> Thanks for choosing SendGrid. This email is to confirm that we have processed your order 23456. This invoice is to be paid by bank transfer within 7 days from the date of your monthly statement. </p> </body> </html> ``` #### Example Outcome: matt@domain.com #### Text ``` Dear Matt, Thanks for choosing SendGrid. This email is to confirm that we have processed your order 34567. You can download your invoice as a PDF for your records. ``` #### HTML ```html <html> <head></head> <body> <p> Dear Matt,<br /> Thanks for choosing SendGrid. This email is to confirm that we have processed your order 34567. You can download your invoice as a PDF for your records. </p> </body> </html> ``` ================================================ FILE: content/docs/ui/sending-email/tls.md ================================================ --- seo: title: Does SendGrid support end-to-end TLS? description: Does SendGrid support end-to-end TLS? keywords: encryption, tls, encrypt, 587, enforce title: Does SendGrid support end-to-end TLS? group: delivery-optimization weight: 0 layout: page zendesk_id: 202523426 navigation: show: true --- By default, our system is designed to opportunistically try outbound TLS v1.1 or higher when attempting to deliver email. This means that if your recipient's email server accepts an inbound TLS v1.1 or higher connection, we will deliver the email over a TLS encrypted connection. If the server does not support TLS, we will deliver the message over the default unencrypted connection. We also offer the ability to _enforce TLS encryption_ when we attempt to deliver email to your recipients. The [Enforced TLS feature](https://sendgrid.api-docs.io/v3.0/settings-enforced-tls) specifies whether or not the recipient is required to support TLS v1.1 or higher or have a valid certificate before we deliver an email to them. ================================================ FILE: content/docs/ui/sending-email/universal-links.md ================================================ --- seo: title: Universal Links description: Learn how to set up universal links with click tracking in your emails. keywords: deep links, universal links, Google, android, Apple, iOS, app, click tracking title: Universal Links group: tracking weight: 0 layout: page navigation: show: true --- <call-out type="warning"> The majority of this setup and management occurs outside of the SendGrid console. SendGrid support can only help with the steps that happen within your SendGrid account - like sender authentication setup. The setup options below are examples, and there are several more CDNs you could use to set up universal links. </call-out> Mobile devices are increasingly becoming the preferred method of receiving, reading, and engaging with email. If you send an email containing a link to your website, but you also have a corresponding mobile application, it is possible to ensure that any recipients who click the link on their mobile device are taken directly to your app instead of their web browsers. This is accomplished by using **universal links**. A universal link is a unique URL that can be configured to open a window in either the recipient's web browser, mobile browser, or mobile application depending on the device the recipient is using. SendGrid enables you to simply tag individual links that you would like to be converted to universal links, without sacrificing the ability to track clicks on those links. <call-out> These links are sometimes referred to as "deep links" in the context of Google's Android OS. Apple uses the term "universal links". Regardless of the OS you are configuring your links for, we will use the term "universal links". </call-out> When setting up universal links for your app, it is important to ensure that you maintain the ability to track when users click those links. After configuring your universal links, we will explain [how to ensure that your universal links are tracked](#resolving-sendgrid-click-tracking-links). <call-out type="warning"> **Marketing Campaigns does not support universal links by default!** If you would like to include universal links in your campaign, you must ensure that you edit the HTML of your template to appropriately [flag your links as universal](#flagging-your-universal-links). </call-out> ## Requirements There are several requirements that you must complete before you can begin using universal links in your email: - Universal links for iOS require an "apple-app-site-association" JSON file. - Universal links for Android require that you set up a "digital asset links" JSON file, along with configuring intent filters in your Android app's manifest file. - Your **apple-app-site-association** and **digital asset links** files must be hosted on an HTTPS web server or content delivery network (CDN). - To ensure that your universal links register click tracking events, and to ensure that your recipient is taken to the correct page within your app, you must properly [resolve your links](#resolving-sendgrid-click-tracking-links). - You must complete the [link branding process]({{root_url}}/ui/account-and-settings/how-to-set-up-link-branding/) for your account. When branding your links, you must use the same domain that will be used for your universal links. (e.g. links.example.com) - On iOS, you must include your branded link subdomain in the "Associated Domains" for your app. You can customize your subdomain using the custom return path in advanced settings while setting it up. Using the example above, you'd need to add an entry for "applinks:links.example.com" like this: ![]({{root_url}}/images/universal_links_ios.png) ## What are "apple-app-site-association" and "digital asset links" files? To keep your app secure, Google and Apple want to restrict which resources or websites are allowed to link directly to different pages within your app. This prevents bad actors from using universal links to gain access to sensitive information within your app. Your "apple-app-site-association" and "digital asset links" files serve as secure means of authenticating your universal links; they verify that your website is allowed to open up a page within your app. <call-out> You must create your own digital asset links and apple-app-site-association files, and you must upload these files to a secure server. </call-out> Both "apple-app-site-association" and "digital asset links" files are comprised of a series of JSON key/value pairs that associate external URLs with pages within your application. **For detailed instructions on how to configure an iOS "apple-app-site-association" file, please see [Apple's Developer Documentation](https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).** **For detailed instructions on how to configure an Android "digital asset links" file, please visit [Google's Developer Documentation](https://developers.google.com/digital-asset-links/v1/getting-started).** ### Example apple-app-site-association file: ```json { "applinks": { "apps": [], "details": [ { "appID": "[YOUR APP ID HERE]", "paths": [ "/uni/*" ] } ] } } ``` <call-out> When configuring your universal links in iOS, you specify which paths you want to be handled by the app by using the `paths` argument in the `apple-app-site-association` file. You must flag your universal links with the attribute `universal=true` as documented [here](#flagging-your-universal-links). In your `apple-app-site-association`, by adding `["/uni/*"]` into `paths`, it ensures your flagged universal links clicks are properly tracked by SendGrid and [are handled by the app appropriately](#resolving-sendgrid-click-tracking-links). </call-out> <call-out type="warning"> **Do not** append the JSON file extension to your apple-app-site-association file! </call-out> ### Example assetlinks.json file: ```json [ { "target": { "namespace": "android_app", "package_name": "[YOUR APP’S PACKAGE NAME]", "sha256_cert_fingerprints": [ "[YOUR APP FINGERPRINT HERE]" ] }, "relation": [ "delegate_permission/common.handle_all_urls" ] } ] ``` <call-out> When configuring your universal links in iOS, you specify which paths you want to be handled by the app by using the `paths` argument in the `apple-app-site-association` file. By specifying only the path `["/uni/*"]`, and using the `universal=true` attribute on your links as documented below, only appropriate links will be handled by the app, and others will be opened in the phone's browser. Android requires that you specify these paths inside your app, rather than the assetlinks.json file. This is accomplished by adding intent filters for specific hosts and paths. Please visit [Google's Android Developer Documentation](https://developer.android.com/training/app-links/deep-linking) to learn how to add an intent filter to your app manifest that can handle your universal links. </call-out> Once you have created and configured your Android and iOS configuration files, you will have to host them on a secure HTTPS server. Keep reading below to learn how you can host these files on either [Amazon CloudFront](https://aws.amazon.com/cloudfront/) or [NGINX](https://www.nginx.com/). ## Setting Up Universal Links Using CloudFront After creating your iOS "apple-app-site-association" file and/or your Android "digital asset links" file, you need to host them on a secure content delivery network. The following instructions will guide you through setting up Amazon's CloudFront to host these files. 1. Navigate to [Amazon CloudFront](https://aws.amazon.com/cloudfront/). Once you have created an account or are logged into your existing account, create a new **S3 bucket** and give it a unique name (e.g. links-example-com) 2. Upload your "apple-app-site-association" file into the root of the new S3 bucket 3. Under **Permissions** on the uploaded file, add a permission for **Everyone** to **Open/Download** (or **Read** in the new S3 UI), then hit **Save** 4. Under **Metadata** on the uploaded file, change the **Content-Type** value to **application/json**, then hit **Save** ![]({{root_url}}/images/universal_links_1.png) 5. Create a new folder in the bucket called “.well-known” 6. Inside of the ".well-known" folder, upload the same "apple-app-site-association" file as in step 2 7. As above, add a permission for **Everyone** to **Open/Download** (or **Read** in the new S3 UI) and change the Content-Type to “application/json” 8. Inside of the “.well-known” folder, upload your “assetlinks.json” 9. Repeat step 7 for your "assetlinks.json" file: add a permission for **Everyone** to **Open/Download** (or **Read** in the new S3 UI) and change the Content-Type to “application/json” 10. Navigate to the **AWS Certificate Manager** 11. Request a new certificate for the domain your link branding is configured for (e.g. links.example.com) 12. AWS will send an email to the appropriate domain owners, requesting them to approve the certificate ![]({{root_url}}/images/universal_links_2.png) 13. Ensure that the certificate is approved and issued 14. Navigate to AWS CloudFront 15. Create a new Distribution that is a Web delivery method 16. Under the **Origin Settings** section, set the fields as follows: ![]({{root_url}}/images/universal_links_3.png) * **Origin Domain Name:** sendgrid.net * **Origin ID:** sendgrid.net * **Origin SSL Protocols:** only TLSv1.2 * **Origin Protocol Policy:** HTTPS Only 17. Under the **Default Cache Behavior Settings** section, set the fields as follows: ![]({{root_url}}/images/cloudfront-cache-based.png) * **Cache Based on Selected Request Headers:** All * **Query String Forwarding and Caching:** Forward all, cache based on all 18. Under the **Distribution Settings** section, set the fields as follows: ![]({{root_url}}/images/universal_links_5.png) * **Alternate Domain Names:** links.example.com * **SSL Certificate:** Custom SSL Certificate, pointing to the appropriate ACM certificate 19. Hit **Create Distribution** 20. Once the distribution is created, click into **Distribution Settings** 21. Under the **Origins** tab, create a new origin with the following details ![]({{root_url}}/images/universal_links_6.png) * **Origin Domain Name:** links-example-com.s3.amazonaws.com * **Origin ID:** s3 22. Click **Create** 23. Under the **Behaviors** tab, create a new behavior with the following details ![]({{root_url}}/images/universal_links_7.png) * **Path Pattern:** apple-app-site-association * **Origin:** s3 * **Viewer Protocol Policy:** HTTPS Only 24. Click **Create** 25. Create another behavior with the following details * **Path Pattern:** .well-known/apple-app-site-association * **Origin:** s3 * **Viewer Protocol Policy:** HTTPS Only 26. Click **Create** 27. Create a third behavior with the following details * **Path Pattern:** .well-known/assetlinks.json * **Origin:** s3 * **Viewer Protocol Policy:** HTTPS Only 28. Hit **Create** 29. Ensure that the **Behaviors** are sorted so that the **Default** is the last onNewIntent ![]({{root_url}}/images/universal_links_8.png) 30. Wait for the distribution to deploy 31. Verify that the distribution serves up the expected files (do this without changing the real DNS to avoid causing any issues with existing links) * https://links.example.com/apple-app-site-association * https://links.example.com/.well-known/apple-app-site-association * https://links.example.com/.well-known/assetlinks.json * https://links.example.com/wf/click?upn= 32. Verify behavior using [https://branch.io/resources/universal-links/](https://branch.io/resources/universal-links/) ## Setting Up Universal Links Using NGINX After creating your iOS "apple-app-site-association" file and/or your Android "digital asset links" file, you need to host them on a secure content delivery network. The following instructions will guide you through setting up NGINX to host these files. 1. Request a new certificate for the domain your link branding is configured for (e.g. links.example.com) 2. Place the certificate chain into the file named **/etc/pki/tls/certs/links.example.com.crt** 3. Place the private key into the file named **/etc/pki/tls/private/links.example.com.key** 4. Create the following directory **/var/www/links.example.com** 5. Create the file **/var/www/links.example.com/apple-app-site-association**, with the appropriate content for your apple-app-site-association file, as explained in [Apple's Developer Documentation](https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html). 6. Create the directory **/var/www/links.example.com/.well-known** 7. Create the file **/var/www/links.example.com/.well-known/apple-app-site-association**, with the appropriate content for your apple-app-site-association file 8. Create the file **/var/www/links.example.com/.well-known/assetlinks.json**, with the appropriate content for your digital asset links file, as explained in [Google's Developer Documentation](https://developers.google.com/digital-asset-links/v1/getting-started#key-terms). 9. Create the file **/etc/nginx/conf.d/links.example.com.conf**, with the following content: ``` server { listen 80; listen 443 ssl; server_name 'links.example.com'; ssl_certificate '/etc/pki/tls/certs/links.example.com.crt'; ssl_certificate_key '/etc/pki/tls/private/links.example.com.key'; location = /apple-app-site-association { root '/var/www/links.example.com'; default_type 'application/json'; } location = /.well-known/apple-app-site-association { root '/var/www/links.example.com'; default_type 'application/json'; } location = /.well-known/assetlinks.json { root '/var/www/links.example.com'; default_type 'application/json'; } location / { proxy_pass 'https://sendgrid.net'; proxy_set_header 'Host' 'links.example.com'; } } ``` ## Flagging Your Universal Links <call-out> It is important to make sure that only the links within your email that point to your app are flagged as universal links. </call-out> It is not unusual to include links to pages outside of your app alongside links to your app in the same email. Not all of these links should be treated as universal links. For example, if you have Facebook or Twitter links tagged as universal links, users will be taken to your app when they click those links instead of being taken to your Facebook and Twitter pages. **To flag links to your app as universal links, simply include the attribute `universal="true"` within the HTML link of your email.** **SendGrid adds the `/uni/` parameter to flagged universal links** For example: `<a href="links.example.com" universal="true">Link to your app!</a>` This way, as long as your association file has the `paths` restricted to `/uni/*` as we recommend above, only the links that you want to be handled by your app will be. If you exclude the `universal="true"` attribute, your links will still function, but they will take your recipient to their mobile browser. If you exclude the `/uni/*` path in your `apple-app-site-association`, the _all_ links for your authenticated domain will be forwarded for your app to handle, which may cause issues. ## Resolving SendGrid Click Tracking Links ### Handling Click Tracking Links In Your App Now that you've successfully set up your app to open SendGrid click tracking links, you'll want to ensure that your app handles them properly. The link your app receives will be the SendGrid encoded link, so you'll want to resolve the link in order to: 1. Trigger the "click" event in your SendGrid account for statistics. 2. Find the original URL to determine which part of your app the user should be taken to. The following code examples help to illustrate what logic should be included within your own app to guarantee that your links are resolved, and tracked by SendGrid. ### Resolving Links in iOS If you have written your app for iOS, you can use `NSURLSession` resolve the link. For example: #### Using Swift ``` func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { if userActivity.activityType == NSUserActivityTypeBrowsingWeb { guard let encodedURL = userActivity.webpageURL else { print("Unable to handle user activity: No URL provided") return false } let task = URLSession.shared.dataTask(with: encodedURL, completionHandler: { (data, response, error) in guard let resolvedURL = response?.url else { print("Unable to handle URL: \(encodedURL.absoluteString)") return } // Now you have the resolved URL that you can // use to navigate somewhere in the app. print(resolvedURL) }) task.resume() } return true } ``` #### Using Objective-C ``` - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler { if (userActivity.activityType == NSUserActivityTypeBrowsingWeb) { NSURL *encodedURL = userActivity.webpageURL; if (encodedURL == nil) { NSLog(@"Unable to handle user activity: No URL provided"); return false; } NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *task = [session dataTaskWithURL:encodedURL completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (response == nil || [response URL] == nil) { NSLog(@"Unable to handle URL: %@", encodedURL.absoluteString); return; } // Now you have the resolved URL that you can // use to navigate somewhere in the app. NSURL *resolvedURL = [response URL]; NSLog(@"Original URL: %@", resolvedURL.absoluteString); }]; [task resume]; } return YES; } ``` ### Resolving Links in Android If you have written your app for Android, you can use `HttpURLConnection` to resolve the URL by setting `setInstanceFollowRedirects` to `false`. For example: #### Using Java ```java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); onNewIntent(getIntent()); } protected void onNewIntent(Intent intent) { String action = intent.getAction(); final String encodedURL = intent.getDataString(); if (Intent.ACTION_VIEW.equals(action) && encodedURL != null) { Log.d("App Link", encodedURL); new Thread(new Runnable() { public void run() { try { URL originalURL = new URL(encodedURL); HttpURLConnection ucon = (HttpURLConnection) originalURL.openConnection(); ucon.setInstanceFollowRedirects(false); URL resolvedURL = new URL(ucon.getHeaderField("Location")); Log.d("App Link", resolvedURL.toString()); } catch (MalformedURLException ex) { Log.e("App Link",Log.getStackTraceString(ex)); } catch (IOException ex) { Log.e("App Link",Log.getStackTraceString(ex)); } } }).start(); } } ``` ================================================ FILE: content/docs/ui/sending-email/unsubscribe-groups.md ================================================ --- layout: page weight: 90 title: Unsubscribe Groups group: delivery-optimization seo: title: Unsubscribe Groups description: Suppression Manager helps you to define and manage unsubscribe groups to keep you out of the spam folder. keywords: subscription manager, suppression manager, unsubscribe manager, unsubscribe manager navigation: show: true --- When a user unsubscribes from a type of email being sent to them at the sender account level, SendGrid will suppress all of your attempts at sending this type of email to that user. This means that the contact information is still in your contact database or you can send this contact’s email via the API. Regardless, emails will not be sent to this contact’s email. For example, if you had an outdated email list (not something we recommend by the way) and sent an email to that list, but a user on that list had previously unsubscribed from that type of email from you, they would not get the email because the email would never leave SendGrid. It would be suppressed from being sent. A contact’s emails will only be suppressed if they unsubscribe from that sender’s emails, unsubscribing from one sender’s list will have no effect on suppression lists owned by other senders. ## Overview Suppression Management gives you the ability to create unsubscribe groups that represent types of email that you regularly send to your recipients. _For example: receipts, social notifications, and account alerts._ You can then give your recipients more control over the types of emails they want to receive by letting them opt out of messages from a certain group. This means getting the right messages to your recipient’s inbox, resulting in a stronger relationship with your recipients and a better sending reputation. <call-out> Make sure your group names and descriptions are customer friendly! Your customers will see these group names and descriptions when they unsubscribe from your emails. </call-out> All of your groups will be visible on the [Suppression Management](https://app.sendgrid.com/suppressions/advanced_suppression_manager) page, along with the descriptions you defined when you created the groups. There are also [Suppression Management API](https://sendgrid.api-docs.io/v3.0/suppressions-suppressions) endpoints for managing your groups and suppressions. ## Add An Unsubscribe Group <call-out> There is a limit of 25 groups per user. </call-out> To add a new group, click the “Create New Group” button at the top right of the page. Then, you will be asked to name your Unsubscribe Group and add the description. Click “Done” and you will see your new group in the list of all of your unsubscribe groups. ### Default Groups Default groups are those that are shown by default when a recipient chooses to unsubscribe from your emails. SendGrid will always show all of the default groups, so if you don’t want one of those groups to be displayed all the time, make sure that it is not set as a default group. You can also specify which groups to display at send time by using the [`"asm_groups_to_display"` feature]({{root_url}}/for-developers/sending-email/suppressions#defining-asm-groups-to-display-on-the-manage-preferences-page) of the SMTP API. ## Add Recipients to an Unsubscribe Group You may want to preload an unsubscribe group or add recipients to an unsubscribe group if you are moving from another email provider or have customers request to be removed from a specific list. We provide 2 ways to do this, via CSV file or manually. ### Upload a CSV To Add Unsubscribe Group Recipients <call-out type="warning"> The emails should not be enclosed in quotes and should NOT be formatted like `fname lname <email@example.com>` </call-out> <call-out> This CSV should have a list of email addresses in the first column. It can include a header row or extra columns, but this ancillary information will be ignored. </call-out> To upload a CSV of recipients who should not receive this group’s emails, click the gear icon at the right of the Unsubscribe Group name. When you select “upload CSV” a window will pop out. Drag your CSV and click “Done”. SendGrid will consume your CSV file and add the emails it finds to your group. From that point on, any emails sent with this group will not go to the recipients in this list. To view which group a recipient is in, go to the [Group Unsubscribes](https://app.sendgrid.com/suppressions/group_unsubscribes) page and search by that recipient’s email address. ### Manually Add Unsubscribe Group Recipients To manually add a recipient who should not receive this group’s emails, click the gear icon at the right of the unsubscribe group name. When you select “manual add” a window will pop out with a form where you can enter a valid email address. Once you click “Done”, any emails sent with this unsubscribe group will not go to this recipient. To view which group a recipient is in, go to the [Group Unsubscribes](https://app.sendgrid.com/suppressions/group_unsubscribes) page and search by that recipient’s email address. ## Export an Unsubscribe Group List If you would like to see which recipients email addresses are in a group or if you would like to migrate one group to another, click the gear icon next to your group name and select “Export”. This will cause a CSV file to download to your browser. ## Edit an Unsubscribe Group To Edit an unsubscribe group, you can either choose “Edit Details” from the gear icon in your unsubscribe group list or you can click the name of your group and click the “Edit Details” button at the top of the screen. From there, you will be able to change the name and description of the group. Click “Save” to keep your changes. ## Delete an Unsubscribe Group <call-out type="warning"> Deleting a group is permanent. It cannot be undone. </call-out> To delete an unsubscribe group, select “Delete” and then “confirm” from the gear icon to the right of your group in the group list or click the name of your group and then click the “Delete” and then “Confirm” buttons. ## Using the API When you use the [SendGrid API with unsubscribe groups](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups/retrieve-all-suppression-groups-associated-with-the-user), you can include the unsubscribe group ID with your mail send calls. To get the ID, go to your unsubscribe group list and you will find the ID in the “Group ID” column. ## Additional Resources - [Bounces]({{root_url}}/ui/sending-email/bounces/) - [Group Unsubscribes](https://app.sendgrid.com/suppressions/group_unsubscribes) - [SendGrid API with unsubscribe groups](https://sendgrid.api-docs.io/v3.0/suppressions-unsubscribe-groups) ================================================ FILE: content/docs/ui/sending-email/warming-up-an-ip-address.md ================================================ --- seo: title: Warming Up an IP Address description: Learn how to warmup your new dedicated IP address and why it's important. keywords: warm, up, warmup, auto, automatic, manual API, v3, ip, pool, warmup, pools title: Warming Up an IP Address group: delivery-optimization weight: 0 layout: page navigation: show: true --- <iframe src="https://player.vimeo.com/video/80755248" width="700" height="400" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> When you add a new dedicated IP address to your account, you need to warm it up. You also need to warmup your IP if you haven't sent on it in more than 30 days. [Warming up your IP]({{root_url}}/glossary/ip-warmup/) allows you to gradually send more emails over your new IP to establish a good [sender reputation]({{root_url}}/glossary/account-reputation-dashboard/). IP warming is the practice of gradually increasing the volume of mail sent with a dedicated IP address according to a predetermined schedule. This gradual process helps to establish a reputation with ISPs (Internet Service Providers) as a legitimate email sender. When an ISP observes email suddenly coming from a new or "cold" IP address, they will take notice and immediately begin evaluating the traffic coming from that IP. Since ISPs treat email volume as a key determining factor when detecting spam, it is best to begin sending a low to moderate volume, eventually working your way up to larger volumes. This gives the receiving email providers a chance to closely observe your sending habits and record how your recipients engage with your email. A gradual warmup does not always guarantee a perfect sending reputation. It is still important to follow sending [best practices](https://sendgrid.com/blog/10-tips-to-keep-email-out-of-the-spam-folder/). <call-out> It is much easier to establish a positive reputation as a new sender, than it is to repair an existing reputation. </call-out> ## Warmup types There are 2 ways to warmup your IP. If your dedicated IP is relatively new, or you've never had one before, you need to warmup your IP manually. If you are adding new dedicated IPs to existing warm IPs, you can automatically warmup your IP with the UI or the API. When your IP is being warmed up, your hourly sending limits are in the table below in the "[Automated IP warmup hourly send schedule]({{root_url}}/ui/sending-email/warming-up-an-ip-address/#automated-ip-warmup-hourly-send-schedule)" section. ### Manually warmup your IP To manually warmup your IP, you need to gradually send more and more email over your IP address at the rate in our suggested [IP Warmup Schedule]({{root_url}}/assets/IPWarmupSchedule.pdf). When sending through a new domain and IP address, you are inherently more susceptible for receiving blocks, deferrals, and other reputation-related email errors because recipient servers do not recognize your mail. It's important to build this reputation over time, which is why we recommend the throttling via IP warm-up as soon as you receive your new dedicated IP. This is a manual process for users with 1 IP and would involve that you segment your sending by breaking up contacts into smaller lists and scheduling your campaigns, as a suggestion. The goal with IP warm-up is to avoid and/or mitigate deliverability issues that come with lack of reputation such as blocks, deferrals, or bounces. <call-out> The goal of warming up is to ramp up your sending volume to your anticipated “normal” levels. For example, if you have a Pro 100k account, you don't need to warmup to 2 million emails as that will exceed your account limits and is unnecessary if you're only sending 100,000 emails a month. </call-out> ### Automated IP warmup In order to take advantage of automated IP warmup, you need to have two or more IP addresses so you can warm up one automatically while the other (already warm IP) acts as an overflow for any emails that exceed the hourly limit. Automatic IP warmup allows Twilio SendGrid to throttle the number of emails for you, avoiding you damaging your sender reputation. *To set up automated IP warmup in the UI:* 1. Go to [Settings > IP Addresses](https://app.sendgrid.com/settings/ip_addresses). 2. Click the action menu for the IP you want to warmup. This brings up the **Edit Your Dedicated IP Address** screen. 3. Select **Use Automated IP warmup**. 4. Save the **Edit Your Dedicated IP Address** screen. ### Automated IP warmup API You can also put your IP address into warmup mode with our [Automated Warmup API](https://sendgrid.api-docs.io/v3.0/ip-warmup) - this automatically throttles traffic sent through your new IP according to our [warmup schedule]({{root_url}}/assets/IPWarmupSchedule.pdf). Any email requests that exceed this hourly limit will overflow to any other existing warm IPs on your account. <call-out type="warning"> When automatically warming up an IP, SendGrid limits the amount of email sent through that IP per hour. Any email requests that exceed this hourly limit will overflow to any other existing warm IPs on your account. If you do not have any other warm IPs, you should warmup your IP manually. </call-out> ### Automated IP warmup hourly send schedule <table class="table table-striped table-bordered"> <tr> <td> Warmup Age (Days) </td> <td> Hourly Email Limit </td> </tr> <tr> <td> 0 </td> <td> 20 </td> </tr> <tr> <td> 1 </td> <td> 28 </td> </tr> <tr> <td> 2 </td> <td> 39 </td> </tr> <tr> <td> 3 </td> <td> 55 </td> </tr> <tr> <td> 4 </td> <td> 77 </td> </tr> <tr> <td> 5 </td> <td> 108 </td> </tr> <tr> <td> 6 </td> <td> 151 </td> </tr> <tr> <td> 7 </td> <td> 211 </td> </tr> <tr> <td> 8 </td> <td> 295 </td> </tr> <tr> <td> 9 </td> <td> 413 </td> </tr> <tr> <td> 10 </td> <td> 579 </td> </tr> <tr> <td> 11 </td> <td> 810 </td> </tr> <tr> <td> 12 </td> <td> 1,000 </td> </tr> <tr> <td> 13 </td> <td> 1,587 </td> </tr> <tr> <td> 14 </td> <td> 2,222 </td> </tr> <tr> <td> 15 </td> <td> 3,111 </td> </tr> <tr> <td> 16 </td> <td> 4,356 </td> </tr> <tr> <td> 17 </td> <td> 6,098 </td> </tr> <tr> <td> 18 </td> <td> 8,583 </td> </tr> <tr> <td> 19 </td> <td> 11,953 </td> </tr> <tr> <td> 20 </td> <td> 16,734 </td> </tr> <tr> <td> 21 </td> <td> 23,427 </td> </tr> <tr> <td> 22 </td> <td> 32,798 </td> </tr> <tr> <td> 23 </td> <td> 45,917 </td> </tr> <tr> <td> 24 </td> <td> 64,284 </td> </tr> <tr> <td> 25 </td> <td> 89,998 </td> </tr> <tr> <td> 26 </td> <td> 125,997 </td> </tr> <tr> <td> 27 </td> <td> 176,395 </td> </tr> <tr> <td> 28 </td> <td> 246,953 </td> </tr> <tr> <td> 29 </td> <td> 345,735 </td> </tr> <tr> <td> 30 </td> <td> 484,029 </td> </tr> <tr> <td> 31 </td> <td> 677,640 </td> </tr> <tr> <td> 32 </td> <td> 948,696 </td> </tr> <tr> <td> 33 </td> <td> 1,328,175 </td> </tr> <tr> <td> 34 </td> <td> 1,859,444 </td> </tr> <tr> <td> 35 </td> <td> 2,603,222 </td> </tr> </table> <call-out> If you are sending transactional emails, you do not need to focus on a strict IP warmup schedule, as you cannot control the rate at which transactional emails will be triggered through the account. If you are sending marketing emails, you will need to follow some sort of IP warmup; this involves gradually increasing your sending day by day on this new IP. The slower you can warm up the better. This way, you can locate and fix any anomalies and issues that arise when you first begin sending, helping your deliverability long term. </call-out> ## Why don't other ESPs require IP warmup? Some email service providers do not offer dedicated IP addresses to their customers - they place all of their customers on shared IP groups by default. Warming up is not required for a shared IP group - SendGrid handles this automatically. Having a dedicated IP allows you to control your own reputation completely, and prevents your sending from being impacted by the reputations of other SendGrid users. ## Additional Resources - [Adding a dedicated IP]({{root_url}}/ui/account-and-settings/dedicated-ip-addresses/) - [IP Access Management]({{root_url}}/ui/account-and-settings/ip-access-management/) - [SendGrid billing information]({{root_url}}/ui/account-and-settings/billing/) ================================================ FILE: content/docs/ui/sending-email/weblink.md ================================================ --- layout: page weight: 0 group: marketing-campaigns title: The Weblink Substitution Tag seo: title: The Weblink Substitution Tag description: The Webklink tag is replaced with a link that will open the email in a Twilio SendGrid-hosted webpage. This feature makes it possible to view an email when an email client fails to open or properly render the message. keywords: design, templates, browser, webpage, open in browser navigation: show: true --- Your emails will likely be opened on a variety of email clients that all support different HTML and CSS features. Email clients may display messages incorrectly, and, in some cases, they may not open a message at all. Inconsistent behavior across email clients is inconvenient at best, and it presents real barriers for recipients who rely on accessibility tools such as screen readers. The Marketing Campaigns Weblink feature makes it possible for recipients to view your email in a Web browser where modern HTML and CSS, as well as accessibility features, are better supported. ## Add Weblink to your design Weblink is a [Substitution Tag]({{root_url}}/ui/sending-email/editor/#using-substitution-tags); however, `{{Weblink}}` is not meant to be included in your design alone. The `{{Weblink}}` tag will be replaced by a URL. This means that you must add the `{{Weblink}}` tag as the URL to a link element — usually some text. For those familiar with HTML, `{{Weblink}}` is assigned to the `href` attribute of an anchor tag. ```html <a href="{{Weblink}}">Open this email in a Web browser</a> ``` ### Design Editor When using the Design Editor, you can add a Weblink as the URL for any link in your design. #### Add the Weblink tag to text using a module's UI 1. In a Text module, add an appropriate call to action such as, "Open this email in a Web browser." 2. Highlight this text and format it as a link using the **Text Module Styles** options. ![Text Module Styles menu with the link icon highlighted]({{root_url}}/img/weblink_text_module_link_tool.png 'Text Module Styles') 3. A modal will appear where you can add the `{{Weblink}}` tag. Select **CustomURL** as the **Link Type**, and type `{{Weblink}}` in the `Link URL` field. ![A modal with two fields, a link type and the link URL]({{root_url}}/img/weblink_add_link_modal.png 'Add Link modal') 4. Select **OK**, and your link will be included in any Single Send or Automation that uses the design. #### Add the Weblink tag using a module's code interface You can also add a link by modifying the underlying HTML code for a drag-and-drop module. 1. Select **Edit Module HTML** from above the module itself. The icon is an opening and closing bracket. ![An opening and closing angle bracket that will open a code editor window for the module.]({{root_url}}/img/weblink_module_edit_html.png 'Edit Module HTML') 2. A code editor will open where you can place an anchor tag. To achieve the same result as when using the UI, your code will look like the following example. Notice that the `{{Weblink}}` tag is placed inside the `href` attribute rather than a regular URL. ```html <div style="font-family: inherit"> <a href="{{Weblink}}">Open this email in a Web browser</a>. </div> ``` ![A module's code editor interface with {{Weblink}} assigned to an href attribute]({{root_url}}/img/weblink_module_code_window.png 'Edit Module HTML') ### Code Editor When using the Code Editor to build your design, you can add `{{Weblink}}` as the `href` attribute for any anchor tag where the link should appear. ![The Code Editor interface with {{Weblink}} assigned to an href attribute]({{root_url}}/img/weblink_code_editor.png 'Add {{Weblink}} to an anchor tag') ## Test Weblink in your design Weblink URLs are generated after your email is scheduled to send. For this reason, you will not be able to test the Weblink directly from the Editors' **Preview** windows when building your Single Send or Automation. Instead, you can send a test email. 1. Using either the Design or Code Editor, select your design's **Settings** tab. Then twirl open the **Test Your Email** menu. 2. Add one of your [verified senders]({{root_url}}/ui/sending-email/sender-verification/) in the **From Address** field and at least one address with an inbox you can check in the **Email Addresses** field. 3. Click the **Send Test Message** button. ![The Editor's Settings tab with example email addresses in the Test Your Email fields]({{root_url}}/img/weblink_test_email.png 'Test Your Email') 4. You should now be able to open the email from the inbox where you sent the message. The test message will contain a working Weblink wherever you placed it in your design. ================================================ FILE: content/docs/ui/sending-email/working-with-marketing-campaigns-email-designs.md ================================================ --- layout: page weight: 85 title: Working with Marketing Campaigns Email Designs group: marketing-campaigns navigation: show: true seo: title: Working with Marketing Campaigns Email Designs override: true description: --- <call-out> This page refers to the new Marketing Campaigns product. If you’re using legacy Marketing Campaigns, your workflow will be a little different and your screen won’t look the same as the screenshots. </call-out> Twilio SendGrid Marketing Campaigns provides a full set of design tools you can use to deliver professional looking templates that render beautifully across email clients. We provide a collection of pre-built, responsive designs that you may begin using and customizing immediately, or you can create your own templates from scratch. Each Design is stored in the Marketing Campaigns Design Library and can be used to deliver [Single Sends]({{root_url}}/glossary/single-send) or [Automations]({{root_url}}/glossary/automated-email). ## The Design Library You can manage all of your Marketing Campaigns designs in the [Design Library](https://mc.sendgrid.com/design-library/your-designs). In addition to storing your current designs, you can browse and duplicate the pre-built [**SendGrid Email Designs**](https://mc.sendgrid.com/design-library/sendgrid-designs) and manage [**Your Images**](https://mc.sendgrid.com/design-library/your-images) from the Design Library as well. ![The Design Library with each navigation tab highlighted and the "Your Designs" tab displayed]({{root_url}}/img/design_library_tabs.png 'The Design Library with "Your Designs" tab displayed.') For more information about managing images with Marketing Campaigns, see the [Image Editor documentation]({{root_url}}/ui/sending-email/image-editor/). <call-out> You can manage your designs programmatically with the [Design Library API](https://sendgrid.api-docs.io/v3.0/designs-api). </call-out> ## Creating a new design To create a new design, you can either build one from a blank template or duplicate an existing templates. ### Building from a blank template <iframe src="https://player.vimeo.com/video/380559291" width="640" height="480" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> 1. Navigate to the **Design Library** in the SendGrid App. 2. When the Design Library loads, you will be taken to the **Your Email Designs** tab. 3. You will see a large **Create Email Design** button on the page. Click this button. ![]({{root_url}}/img/design_library_create_email_design_button.png) 4. After clicking **Create Email Design**, a new window will open where you can select which editor you wish to use—the **Design Editor** or the **Code Editor**. ![A window with two large boxes displaying your choice of editor, the Design Editor or Code Editor]({{root_url}}/img/create_design_editor_options.png 'Choose an editor') The Design Editor makes it possible to build and edit an email template with drag and drop modules that require no coding. The Code Editor is appropriate for customers who wish to build and edit templates by manipulating the HTML code directly. Once a design is created, it is not possible to change the editor used for that design. However, if you choose the design editor you'll still have HTML editing options, and with the code editor you'll enjoy convenient visual tools like side-by-side code and preview panes. For full documentation on working with the editors, see our [Design and Code Editor documentation]({{root_url}}/ui/sending-email/editor/). For best practices regarding HTML email design, see our [Cross-Platform Email Design documentation]({{root_url}}/ui/sending-email/cross-platform-html-design/). 5. Once you have selected an editor, the template will load in that editor and you can begin working with your template. <call-out> Developers can use the [POST /designs API endpoint](https://sendgrid.api-docs.io/v3.0/designs-api/create-design) to programmatically upload a design. </call-out> ### Duplicating an existing design You can create a new template by duplicating one of your existing templates or duplicating one of the Twilio SendGrid pre-built designs. <iframe src="https://player.vimeo.com/video/380558358" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> 1. From the **Design Library** select the **Your Email Designs** tab to duplicate one of your existing designs. Select **SendGrid Email Designs** to duplicate a Twilio SendGrid pre-built design. ![The Design Library tabs to select between your designs and the pre-built designs]({{root_url}}/img/design_library_duplicate_tabs.png 'Select which templates you want to duplicate') 2. Click the **action menu** at the bottom of the design you want to copy and select **Duplicate** ![The design duplication menus highlighted in the Design Library]({{root_url}}/img/design_library_duplicate_your_designs.png 'Duplicate one of your designs') 3. After clicking **Duplicate**, a new window will open where you can select which editor you wish to use—the **Design Editor** or the **Code Editor**. 4. Once you have selected an editor, the template will load in that editor and you can begin working with your copy of the template. <call-out> Duplicated designs will have "Duplicate:" prepended to the **Email Design Name** by default. This text is meant to help you differentiate a duplicate from the original design until you change the name yourself. </call-out> <call-out> Developers can use the [POST /designs/{id} API endpoint](https://sendgrid.api-docs.io/v3.0/designs-api/duplicate-design) to programmatically duplicate one of their own designs and the [POST /designs/pre-builts/{id} API endpoint](https://sendgrid.api-docs.io/v3.0/designs-api/duplicate-sendgrid-pre-built-design) to duplicate one of the Twilio SendGrid designs. </call-out> ## Editing a design You can edit any of the designs in the **Your Email Designs** tab. You cannot edit one of the pre-built designs directly; you must duplicate the template first and make changes to your copy. 1. Navigate to the design you want to edit. 2. Click the **action menu** at the bottom of the design you want to modify and select **Edit**. ![The Edit menu item button below a design]({{root_url}}/img/design_library_edit_your_designs.png 'Edit a design') 3. The template will open in the editor originally used to create the campaign—the **Design Editor** or the **Code Editor**. After you create a design, you cannot switch between the design and code editor to modify that particular template. If you wish to switch editors, you can duplicate the design and select the alternate editor during the duplication process. ## Designs and Single Sends You can use any of your designs to deliver a [Single Send]({{root_url}}/glossary/single-send/). Single Sends are one-time nonautomated email messages commonly used to deliver newsletters, promotions, policy updates, and more. You can either create a Single Send from a design or add a design to your Design Library from a Single Send. ## Create a Single Send from an existing design 1. In the **Design Library**, you can select either the **Your Email Designs** or **SendGrid Email Designs** tab. 2. Click the **action menu** at the bottom of the design you want to use for your Single Send and select **Create Single Send**. ![The Create a Single Send menu item button below a design]({{root_url}}/img/design_library_create_single_send.png 'Create a Single Send from a design') 3. After clicking **Create Single Send**, a new window will open where you can select which editor you wish to use—the **Design Editor** or the **Code Editor**. ![A window displaying two large boxes as editor options, the Design Editor or the Code Editor]({{root_url}}/img/create_single_send_editor_choice.png 'Choose an editor for your Single Send') 4. Once you select an editor, your Single Send will open, allowing you to finish the Single Send setup process. For more information about delivering a Single Send, see [How to Send Email with new Marketing Campaigns]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) <call-out> You can manage Single Sends programmatically with the [Single Sends API](https://sendgrid.api-docs.io/v3.0/single-sends). </call-out> ## Create a new design from an existing Single Send If you have a Single Send that uses a design you would like to manage in your Design Library, you can add the design from the Single Send. 1. From the left-hand navigation, select **Marketing**, and then click **Single Sends**. ![The SendGrid App with the Marketing Campaigns and Single Sends navigation items highlighted]({{root_url}}/img/marketing_single_sends_nav_item.png 'Single Sends navigation menu item') 2. Find the Single Send you would like to create a design from, click the **action menu** and select **Create Design**. ![The action menu expanded below a Single Send with the Create Design menu item selected]({{root_url}}/img/single_send_create_design.png 'Create a design from a Single Send') 3. After clicking **Create Design**, a new window will open where you can select which editor you wish to use—the **Design Editor** or the **Code Editor**. 4. The Design used by the Single Send will now be added to your Design Library where you can edit, duplicate, and use it to deliver more Single Sends or Automations. ## Designs and Automations [Automations]({{root_url}}/ui/sending-email/getting-started-with-automation/) allow you to send recurring emails or drip series automatically at a cadence you define. You can use any of the designs in the **Your Email Designs** or **SendGrid Email Designs** tabs to deliver one of the messages in your Automation series. You can also save a design from an Automation email to your Design Library. ### Create a new template from an existing Automation email 1. From the left-hand navigation, select **Marketing**, and then click **Automations**. 2. Click the action menu next to the automation you want to duplicate an email from and then select **Edit**. ![The Edit option selected from the action menu on an Automation]({{root_url}}/img/automation_action_menu_edit.png 'Edit an Automation') 3. After selecting **Edit**, the Automation will load. Scroll to the email in the Automation that you would like to create a design from. 4. Click the **action menu**, and then select **Create Design**. ![The Create Design option selected in an Automation email's action menu]({{root_url}}/img/create_design_from_automation_email.png 'Create a design from an Automation email') 4. After clicking **Create Design**, a new window will open where you can select which editor you wish to use—the **Design Editor** or the **Code Editor**. 5. The Design used by the Automation email will now be added to your Design Library where you can edit, duplicate, and use it to deliver more Automations or Single Sends. For more information about creating an Automation and assigning designs to the emails in a series, see [Getting Started with Automations]({{root_url}}/ui/sending-email/getting-started-with-automation/). ## Working with the Design and Code editors The Design and Code editors are both feature rich applications that include live previews, the ability to add test data, and more. For more detailed documentation about working with each editor, see our [Design and Code Editor documentation]({{root_url}}/ui/sending-email/editor/). ## Additional Resources - [Sending an Email]({{root_url}}/ui/sending-email/how-to-send-email-with-marketing-campaigns/) - [The Design and Code Editors]({{root_url}}/ui/sending-email/editor/) - [Cross-Platform Email Design]({{root_url}}/ui/sending-email/cross-platform-html-design/) - [Handlebars]({{root_url}}/for-developers/sending-email/using-handlebars/) - [Designs API reference](https://sendgrid.api-docs.io/v3.0/designs-api) ================================================ FILE: data/SiteConfig.js ================================================ const config = { env: process.env.NODE_ENV, docsDir: 'docs', siteTitle: 'SendGrid Documentation', siteTitleAlt: 'SendGrid Knowledge Center', siteLogo: 'https://sendgrid.com/brand/sg-twilio/sg-twilio-lockup.svg', ogImage: 'https://sendgrid.com/brand/sg-twilio/SG_Twilio_Lockup_Social.png', siteUrl: 'https://sendgrid.com', gitHubMarkdownPath: 'https://github.com/sendgrid/docs/tree/develop/content/docs', pathPrefix: '/docs', siteDescription: 'Learn how to get started using SendGrid. Integrate in minutes, test for free, and get access to documents to help solve your email deliverability problems.', siteRss: '/rss.xml', googleAnalyticsID: 'UA-12399264-1', userTwitter: 'sendgrid', }; config.envPrefix = process.env.NODE_ENV === 'development' ? '' : config.pathPrefix; module.exports = config; ================================================ FILE: first-timers-tr.md ================================================ # GitHub ile SendGrid Belgeleri Nasıl Düzenlenir SendGrid Belgelerini Düzenleme kolaydır! Bir hata veya yazım hatası görürseniz veya eklemek istediğiniz bir şey varsa önerilerinizi Dokümanlar için kullandığımız içerik yönetim sistemi olan GitHub ile yapabilirsiniz. Önerinizi gönderdikten sonra Dokümanlar ekibi, Dokümanlar web sitesine yayınlanmadan önce kolayca inceleyebilir. https://sendgrid.com/docs adresindeki herhangi bir sayfada değişiklik yapmak için şu adımları izleyin: 1- Düzenlemek istediğiniz sayfaya gidin ve sayfanın altındaki -Bu sayfayı düzenle-'yi tıklayın. Bu sizi sendgrid.com/docs GitHub deposuna veya repo'ya götürecektir. Bu, doküman sayfalarımızın saklandığı yerdir. 2- Eğer bir GitHub hesabınız yoksa, değişiklik önermek için bir tane oluşturmanız gerekir. Bir hesap oluşturmak için sağ üst köşedeki Kayıt bağlantısını tıklayın. Kullanıcı adınızı, şifrenizi ve e-posta adresinizi girin. SendGrid çalışanıysanız, tam adınızı GitHub hesabınızla birlikte kullanın ve SendGrid'i şirketiniz olarak girin, böylece sizi kolayca tanımlayabiliriz. GitHub'da bir Dokümanlar sayfasını görüntüledikten sonra, düzenlemeye başlamak için kurşun kalem simgesini tıklayın. 3- Değişikliklerinizi yaptıktan sonra, Çekme İsteğinde yeni bir şube oluşturma seçeneğine sahip olacaksınız. Bu, orijinal Dokümanlar'ın bir kopyasını veya dalını oluşturma isteğiniz, ancak değişikliklerinizle ilgilidir. Değişiklikleriniz onaylandıktan sonra, şubeniz tekrar orijinaline birleştirilir. 4- Bir Çekme İsteği oluşturmak için bir Taahhüt Değişikliği formu doldurmanız gerekir. Yerleşik şablonu takip edin ve sayfaya yaptığınız tüm değişiklikler hakkında bilgi verin. Varsayılan şube seçeneğini ve adını bırakın. 5- Bittiğinde, Dosya değişikliğini öner'i tıklayın. Dokümanlar Ekibi isteğiniz hakkında bilgilendirilecek. Değişikliği gözden geçirdikten sonra, siteye yayınlayacağız! SendGrid belgelerinin tüm katılımcıları, değişikliklerin birleştirilebilmesi için bir CLA imzalaması gerekir. SendGrid Belgeleri belirli stil kurallarına uymalıdır. Bu yönergelerin birçoğu küçük değişiklikler için geçerli olmasa da, Dokümanlar’nızın aşağıdakilerden emin olmamız önemlidir: - Özlü - Doğru - Organize edilmiş - Taranabilir Dokümanlar katkıda bulunanlar profesyonel ve “koça benzeyen” bir ses tonu için çabalamalıdır. Belirsiz dil kullanmaktan kaçının ve doğru noktaya ulaşın. Uzun ve aşırı karmaşık açıklamalar, hızlı ve kolay bir cevap isteyen bir kullanıcıya yardımcı olmaz. Lütfen bu stil yönergelerine göre korkmayın. Çoğu küçük değişikliğe uygulanmazlar ve daha önemli değişiklikler yayınlanmadan önce Dokümanlar Ekibi tarafından incelenir ve düzenlenir. Önemli düzenlemeler yapıyorsanız veya yeni içeriğin bir paragrafından fazlasını ekliyorsanız, SendGrid’in Stil Kılavuzu’na başvurmaktan çekinmeyin. ================================================ FILE: first-timers.md ================================================ # How To Edit the SendGrid Docs via GitHub Editing the SendGrid Documentation is easy! If you see an error, a typo, or have something you would like to add, you can make your suggestion via GitHub, the content management system we use for the Docs. Once you have submitted your suggestion, the Docs team can easily review it before it is published to the Docs website. To make changes to any page on https://sendgrid.com/docs, follow these steps: 1. Navigate to the page you would like to edit and click **Edit this page** at the bottom of the page. <img src="https://github.com/sendgrid/docs/blob/develop/static/img/edit-this-page.png" width="800" height="500"> This will take you to the sendgrid.com/docs GitHub repository, or repo. This is where our docs pages are stored. 2. If you do not already have a GitHub account, you will have to create one in order to suggest a change. Click the Sign up link in the upper right-hand corner to create an account. Enter your username, password, and email address. If you are an employee of SendGrid, please use your full name with your GitHub account and enter SendGrid as your company so we can easily identify you. <img src="https://github.com/sendgrid/docs/blob/develop/static/img/docs_signup.png" width="800" height="500"> Once you are viewing a Docs page in GitHub, click the pencil icon to begin editing: <img src="https://github.com/sendgrid/docs/blob/develop/static/img/docs_edit_github.png" width="800" height="500"> 3. Once you have made your changes, you will be given the option of creating a new branch in a Pull Request. This is a request to create a copy, or branch, of the original Docs but with your changes. Once your changes are approved, your branch will then be merged back into the original. 4. To create a Pull Request, you’ll have to fill out a Commit Changes form. Follow the built-in template and provide information about any changes you have made to the page. Leave the default branch option and name. 5. When done, click **Propose file change**. The Docs Team will be notified of your request. Once we are able to review the change, we will publish it to the site! > All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under. The SendGrid Documentation must follow certain style guidelines. While many of these guidelines are not applicable to small changes, it is important to make sure that our Docs are: * Concise * Accurate * Organized * Scannable Docs contributors should strive for a professional and “coach-like” tone of voice. Avoid vague language, and get right to the point. Long and overly complicated explanations are not helpful to a user who wants a quick-and-easy answer. Please don’t be intimidated by these style guidelines. They don’t apply to most minor changes, and more significant changes will be reviewed and edited by the Docs Team before publication. If you are making substantial edits or are adding more than a paragraph of new content, feel free to refer to [SendGrid’s Style Guide](https://github.com/sendgrid/docs/blob/develop/styleguide.md). ================================================ FILE: gatsby-browser.js ================================================ exports.onClientEntry = () => { (function () { const path = 'https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css'; const link = document.createElement('link'); link.setAttribute('rel', 'stylesheet'); link.setAttribute('type', 'text/css'); link.setAttribute('href', path); document.head.appendChild(link); // require('./src/scss/style-guide.scss'); }()); }; /** * Push PageCategory as 'docs' to dataLayer */ exports.onRouteUpdate = () => { window.dataLayer = [ { PageCategory: 'docs' }, ...window.dataLayer, ]; }; ================================================ FILE: gatsby-config.js ================================================ const config = require('./data/SiteConfig'); const pathPrefix = config.pathPrefix === '/' ? '' : config.pathPrefix; const policyAccess = process.env.GATSBY_ENV === 'production' ? [{ userAgent: '*', allow: ['/'] }] : [{ userAgent: '*', disallow: ['/'] }]; module.exports = { pathPrefix: config.pathPrefix, siteMetadata: { siteUrl: config.siteUrl, rssMetadata: { site_url: config.siteUrl + pathPrefix, feed_url: config.siteUrl + pathPrefix + config.siteRss, title: config.siteTitle, description: config.siteDescription, image_url: `${config.siteUrl + pathPrefix}/logos/logo-512.png`, author: config.userName, copyright: config.copyright, }, }, plugins: [ 'gatsby-plugin-react-helmet', 'gatsby-plugin-sass', 'gatsby-plugin-sitemap', { resolve: 'gatsby-source-filesystem', options: { name: 'docs', path: `${__dirname}/content/${config.docsDir}`, }, }, { resolve: 'gatsby-plugin-robots-txt', options: { host: config.siteUrl + pathPrefix, sitemap: `${config.siteUrl}/docs/sitemap.xml`, policy: policyAccess, }, }, { resolve: 'gatsby-plugin-google-tagmanager', options: { id: 'GTM-PQC59L', includeInDevelopment: true, }, }, { resolve: 'gatsby-transformer-remark', options: { plugins: [ 'sendgrid-remark-code-in-html', 'sendgrid-remark-paths', { resolve: 'gatsby-remark-images', options: { maxWidth: 690, }, }, { resolve: 'gatsby-remark-responsive-iframe', }, 'gatsby-remark-prismjs', 'gatsby-remark-copy-linked-files', // 'gatsby-remark-autolink-headers', 'sendgrid-remark-headers', 'sendgrid-remark-tables', ], }, }, { resolve: 'gatsby-plugin-nprogress', options: { color: config.themeColor, }, }, 'gatsby-plugin-sharp', 'gatsby-plugin-catch-links', { resolve: 'gatsby-plugin-segment-js', options: { prodKey: '1CjnBNPybWzyv10ssZRxdwmb8vrYF4yj', devKey: 'QaZKJjbUWrCqNO0ObRrF64qDRVE40ZIr', // This is done via GTM. trackPage: true, }, }, { resolve: 'gatsby-plugin-manifest', options: { name: config.siteTitle, short_name: config.siteTitle, description: config.siteDescription, start_url: config.pathPrefix, background_color: config.backgroundColor, theme_color: config.themeColor, display: 'minimal-ui', icons: [ { src: '/brand/sg-mark.png', sizes: '771x724', type: 'image/png', }, ], }, }, // 'gatsby-plugin-offline', ], }; ================================================ FILE: gatsby-node.js ================================================ const path = require('path'); const _ = require('lodash'); const webpackLodashPlugin = require('lodash-webpack-plugin'); const crypto = require('crypto'); /** * Generate node edges * * @param {any} { node, actions, getNode } */ exports.onCreateNode = ({ node, actions, getNode }) => { const { createNodeField } = actions; /** * Add slug edge */ let slug; if (node.internal.type === 'MarkdownRemark') { const fileNode = getNode(node.parent); const parsedFilePath = path.parse(fileNode.relativePath); if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'slug') ) { slug = `/${node.frontmatter.slug}`; } else if (parsedFilePath.name !== 'index' && parsedFilePath.dir !== '') { slug = `/${parsedFilePath.name}/`; } else { slug = `/${parsedFilePath.dir}/`; } if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'slug') ) { slug = `/${_.kebabCase(node.frontmatter.slug)}`; } createNodeField({ node, name: 'slug', value: _.kebabCase(slug).toLowerCase(), }); /** * Add permalink edge * * If there is a path frontmatter - that overrides all. * Otherwise, we'll use the nested directory structure to build the permalink. */ let permalink; if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'path') ) { permalink = `/${node.frontmatter.path}${slug}`; } else if (parsedFilePath.dir !== '') { permalink = `/${parsedFilePath.dir}${slug}`; } else { permalink = slug; } createNodeField({ node, name: 'permalink', value: permalink.toLowerCase(), }); /** * Check if doc is "ui", "for developers", "glossary" or "release-notes" and add a field slug to represent this. */ let docType; if (permalink.match(/ui\/[^/]+/)) { docType = 'ui'; } else if (permalink.match(/for-developers\/[^/]+/)) { docType = 'for-developers'; } else if (permalink.match(/glossary\/[^/]+/)) { docType = 'glossary'; } else if (permalink.match(/release-notes\/[^/]+/)) { docType = 'release-notes'; } createNodeField({ node, name: 'docType', value: docType }); let cat; if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'category') ) { cat = node.frontmatter.category; } else { // remove docType prefix cat = parsedFilePath.dir.replace(`${docType}`, ''); cat = cat.split('/'); cat = cat.length > 1 && cat[1].length ? cat[1] : 'uncategorized'; } createNodeField({ node, name: 'category', value: cat }); let group = 'ungrouped'; if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'group') ) { group = node.frontmatter.group; } createNodeField({ node, name: 'group', value: group }); let title; if ( Object.prototype.hasOwnProperty.call(node, 'frontmatter') && Object.prototype.hasOwnProperty.call(node.frontmatter, 'title') ) { title = node.frontmatter.title; } else { title = parsedFilePath.name.replace('-', ''); } createNodeField({ node, name: 'title', value: title }); } }; exports.createPages = ({ graphql, actions }) => { const { createPage } = actions; return new Promise((resolve, reject) => { const docsPage = path.resolve('src/templates/doc.jsx'); const categoryPage = path.resolve('src/templates/category.jsx'); resolve( graphql(` { allMarkdownRemark { edges { node { id fileAbsolutePath fields { permalink slug category docType } } } } } `).then((result) => { if (result.errors) { /* eslint no-console: "off" */ console.log(result.errors); reject(result.errors); } const helpCategorySet = new Set(); const developerCategorySet = new Set(); result.data.allMarkdownRemark.edges.forEach((edge) => { const { category, docType } = edge.node.fields; // aggregate "ui" categories if (docType === 'ui') { helpCategorySet.add(category); } // aggregate "for-developers" categories if (docType === 'for-developers') { developerCategorySet.add(category); } // Create docs pages const { permalink } = edge.node.fields; createPage({ path: permalink, component: docsPage, context: { slug: edge.node.fields.slug, id: edge.node.id, }, }); }); const categoryList = Array.from(developerCategorySet); categoryList.forEach((category, i) => { // Create "for-developer" category nodes. const cat = { id: `${i}`, slug: category, parent: '__SOURCE__', children: [], internal: { type: 'forDeveloperCategories', }, }; // Get content digest of node. (Required field) const contentDigest = crypto .createHash('md5') .update(JSON.stringify(cat)) .digest('hex'); // add it to contentNode cat.internal.contentDigest = contentDigest; // Create "/for-developers/<category-slug>" pages. createPage({ path: `/for-developers/${_.kebabCase(category)}/`, component: categoryPage, context: { docType: 'for-developers', category, }, }); }); const helpCategoryList = Array.from(helpCategorySet); helpCategoryList.forEach((category, i) => { // Create "ui" category nodes. const cat = { id: `${i}`, slug: category, parent: '__SOURCE__', children: [], internal: { type: 'helpSupportCategories', }, }; // Get content digest of node. (Required field) const contentDigest = crypto .createHash('md5') .update(JSON.stringify(cat)) .digest('hex'); // add it to userNode cat.internal.contentDigest = contentDigest; // Create "/ui/<category-slug>" pages. createPage({ path: `/ui/${_.kebabCase(category)}/`, component: categoryPage, context: { docType: 'ui', category, }, }); }); }) ); }); }; exports.onCreateWebpackConfig = ({ stage, actions }) => { if (stage === 'build-javascript') { actions.setWebpackConfig({ plugins: [webpackLodashPlugin], }); } }; ================================================ FILE: jsconfig.json ================================================ { "compilerOptions": { "target": "ES6", "allowSyntheticDefaultImports": true, "experimentalDecorators": true, "baseUrl": "src", "paths": { "*": ["*", "src/*"] } }, "typeAcquisition": { "enable": true }, "typingOptions": { "enableAutoDiscovery": true }, "compileOnSave": true, "allowJS": true, "include": [ "src/**/*" ] } ================================================ FILE: license ================================================ The MIT License (MIT) Copyright © 2013-2019 Twilio SendGrid Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: package.json ================================================ { "name": "sendgrid-docs", "description": "SendGrid Docs", "version": "1.1.0", "author": "Justin W. Hall <justin.hall@sendgrid.com>", "dependencies": { "axios": "^0.21.1", "babel-plugin-lodash": "^3.3.4", "babel-polyfill": "^6.26.0", "gatsby": "^2.32.13", "gatsby-cli": "^2.19.3", "gatsby-link": "^2.10.0", "gatsby-plugin-catch-links": "^2.9.0", "gatsby-plugin-feed": "^2.13.1", "gatsby-plugin-google-analytics": "^2.10.0", "gatsby-plugin-google-tagmanager": "^2.10.0", "gatsby-plugin-manifest": "^2.12.1", "gatsby-plugin-nprogress": "^2.9.0", "gatsby-plugin-offline": "^3.10.2", "gatsby-plugin-react-helmet": "^3.9.0", "gatsby-plugin-robots-txt": "^1.6.2", "gatsby-plugin-sass": "^2.8.0", "gatsby-plugin-segment-js": "^3.6.1", "gatsby-plugin-sharp": "^2.14.4", "gatsby-plugin-sitemap": "^2.11.0", "gatsby-plugin-twitter": "^2.9.0", "gatsby-remark-autolink-headers": "^2.10.0", "gatsby-remark-copy-linked-files": "^2.9.0", "gatsby-remark-images": "^3.11.1", "gatsby-remark-prismjs": "^3.12.0", "gatsby-remark-responsive-iframe": "^2.10.0", "gatsby-source-filesystem": "^2.11.1", "gatsby-transformer-remark": "^2.16.1", "github-slugger": "^1.3.0", "js-cookie": "^2.2.1", "lodash": "^4.17.21", "lodash-webpack-plugin": "^0.11.6", "marked": "^2.0.7", "mdast-util-to-string": "^1.1.0", "node-fetch": "^2.6.1", "node-sass": "^4.14.1", "prismjs": "^1.23.0", "react": "^16.14.0", "react-dom": "^16.14.0", "react-helmet": "^6.1.0", "react-share": "^4.4.0", "rehype-react": "^5.0.1", "s3-deploy": "^1.4.0", "stylelint-selector-bem-pattern": "^2.1.0", "unist-util-visit": "^2.0.3", "yarn": "^1.22.10" }, "devDependencies": { "cli-glob": "^0.1.0", "eslint": "^6.8.0", "eslint-config-airbnb": "^18.2.1", "eslint-config-prettier": "^6.15.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-react": "^7.24.0", "gh-pages": "^2.2.0", "prettier": "^2.3.0", "remark-cli": "^8.0.1", "remark-preset-lint-recommended": "^4.0.1", "stylefmt": "^6.0.3", "stylelint": "^13.13.0", "stylelint-config-standard": "^20.0.0" }, "keywords": [ "gatsby" ], "license": "MIT", "main": "n/a", "scripts": { "develop": "gatsby develop", "dev": "npm run develop", "serve": "gatsby serve", "build": "gatsby build", "build:pp": "gatsby build --prefix-paths", "build:gh": "npm run clean && npm run build:pp && gh-pages -d public", "clean": "rm -rf public", "lint:js": "eslint --ext .js,.jsx .", "lint:md": "remark content/docs/", "format:js": "prettier '**/*.{js,jsx}' --write" }, "remarkConfig": { "plugins": [ "remark-preset-lint-recommended" ] } } ================================================ FILE: plugins/sendgrid-remark-code-in-html/index.js ================================================ const visit = require('unist-util-visit'); module.exports = ({ markdownAST }) => { visit(markdownAST, 'html', (node) => { let remarked = node.value.replace(/```raw/g, '<pre class="language-text"><code>'); remarked = remarked.replace(/```/g, '</code></pre>'); node.value = remarked; }); return markdownAST; }; ================================================ FILE: plugins/sendgrid-remark-code-in-html/package.json ================================================ {} ================================================ FILE: plugins/sendgrid-remark-headers/index.js ================================================ const toString = require('mdast-util-to-string'); const visit = require('unist-util-visit'); const slugs = require('github-slugger')(); function patch(context, key, value) { if (!context[key]) { context[key] = value; } return context[key]; } module.exports = ({ markdownAST }) => { slugs.reset(); visit(markdownAST, 'heading', (node) => { const id = slugs.slug(toString(node)); const data = patch(node, 'data', {}); patch(data, 'id', id); patch(data, 'htmlAttributes', {}); patch(data, 'hProperties', {}); patch(data.htmlAttributes, 'id', id); patch(data.hProperties, 'id', id); patch(data.hProperties, 'class', 'sg-remarked-linked-header'); node.children.unshift({ type: 'link', url: `#${id}`, title: null, data: { hProperties: { 'aria-hidden': true, class: 'anchor', 'data-slug': id, }, hChildren: [ { type: 'raw', // The Octicon link icon. value: '<svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>', }, ], }, }); }); return markdownAST; }; ================================================ FILE: plugins/sendgrid-remark-headers/package.json ================================================ {} ================================================ FILE: plugins/sendgrid-remark-paths/index.js ================================================ const visit = require('unist-util-visit'); module.exports = ({ markdownAST, pathPrefix }) => { const uriPrefix = pathPrefix.length ? pathPrefix : ''; // Replace {{root_url}} for all links visit(markdownAST, 'link', (node) => { if ( node.url && node.url.startsWith('{{root_url}}') ) { node.url = node.url.replace('{{root_url}}', uriPrefix); } }); // Replace {{root_url}} for all imags visit(markdownAST, 'image', (node) => { if ( node.url && node.url.startsWith('{{root_url}}') ) { node.url = node.url.replace('{{root_url}}', uriPrefix); } }); return markdownAST; }; ================================================ FILE: plugins/sendgrid-remark-paths/package.json ================================================ {} ================================================ FILE: plugins/sendgrid-remark-tables/index.js ================================================ const visit = require('unist-util-visit'); const cheerio = require('cheerio'); module.exports = ({ markdownAST }) => { visit(markdownAST, 'html', (node) => { const $ = cheerio.load(node.value); const table = $('table'); if (table.length) { const rawHTML = ` <div class="table-wrap"> ${table} </div> `; node.data = { hChildren: [{ type: 'raw', value: rawHTML }], // Set type to unknown so mdast-util-to-hast will treat this node as a // div not an iframe — it gets quite confused otherwise. }; node.type = 'unknown'; // Also apparently, for html node types, you have to delete the value // in order for mdast-util-to-hast to use hChildren. If even if // you change the node type to unknown... delete node.value; } }); return markdownAST; }; ================================================ FILE: plugins/sendgrid-remark-tables/package.json ================================================ {} ================================================ FILE: redirects.js ================================================ module.exports = [ { from: '/User_Guide/Transactional_Templates/how_to_send_an_email_with_transactional_templates.html', to: '/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', }, { from: '/Integrate/Partners/account-migration.html', to: '/for-developers/partners/account-migration/', }, { from: '/Apps/index.html', to: '/ui/account-and-settings/account/', }, { from: '/Apps/address_whitelisting.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/bcc.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/bypass_list_management.html', to: '/ui/account-and-settings/mail/ ', }, { from: '/Apps/click_tracking.html', to: '/ui/account-and-settings/tracking/ ', }, { from: '/Apps/domain_keys.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/ ', }, { from: '/Apps/dkim.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/ ', }, { from: '/Apps/email_templates.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/event_notification.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/footer.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/forward_spam.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/google_analytics.html', to: '/ui/account-and-settings/tracking/ ', }, { from: '/Apps/gravatar.html', to: '/ui/account-and-settings/account/', }, { from: '/Apps/new_relic.html', to: '/ui/account-and-settings/partners/', }, { from: '/Apps/open_tracking.html', to: '/ui/account-and-settings/tracking/ ', }, { from: '/Apps/return_path_seedlist.html', to: '/ui/account-and-settings/account/', }, { from: '/Apps/sendwithus.html', to: '/ui/account-and-settings/partners/', }, { from: '/Apps/spam_checker.html', to: '/ui/account-and-settings/mail/', }, { from: '/Apps/subscription_tracking.html', to: '/ui/account-and-settings/tracking/ ', }, { from: '/Apps/template_engine.html', to: '/ui/sending-mail/create-and-edit-transactional-templates/', }, { from: '/Code_Examples/index.html', to: '/for-developers/', }, { from: '/Code_Examples/csharp.html', to: '/for-developers/sending-email/v3-csharp-code-example/', }, { from: '/Code_Examples/go.html', to: '/for-developers/sending-email/v3-go-code-example/', }, { from: '/Code_Examples/ios.html', to: '/for-developers/', }, { from: '/Code_Examples/java.html', to: '/for-developers/sending-email/v3-java-code-example/', }, { from: '/Code_Examples/nodejs.html', to: '/for-developers/sending-email/v3-nodejs-code-example/', }, { from: '/Code_Examples/perl.html', to: '/for-developers/sending-email/v2-perl-code-example/', }, { from: '/Code_Examples/php.html', to: '/for-developers/sending-email/v3-php-code-example/', }, { from: '/Code_Examples/python.html', to: '/for-developers/sending-email/smtp-python-code-example/', }, { from: '/Code_Examples/ruby.html', to: '/for-developers/sending-email/v3-ruby-code-example/', }, { from: '/Code_Examples/Webhook_Examples/index.html', to: '/for-developers/tracking-events/', }, { from: '/Code_Examples/Webhook_Examples/go.html', to: '/for-developers/tracking-events/go-code-example/', }, { from: '/Code_Examples/Webhook_Examples/nodejs.html', to: '/for-developers/tracking-events/nodejs-code-example/', }, { from: '/Code_Examples/Webhook_Examples/php.html', to: '/for-developers/tracking-events/php-code-example/', }, { from: '/Code_Examples/Webhook_Examples/python.html', to: '/for-developers/tracking-events/python-code-example/', }, { from: '/Code_Examples/Webhook_Examples/csharp.html', to: '/for-developers/tracking-events/csharp-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/index.html', to: '/for-developers/sending-email/building-an-smtp-email/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/go.html', to: '/for-developers/sending-email/smtp-go-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/nodejs.html', to: '/for-developers/sending-email/smtp-nodejs-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/perl.html', to: '/for-developers/sending-email/smtp-perl-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/php.html', to: '/for-developers/sending-email/smtp-php-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/python.html', to: '/for-developers/sending-email/smtp-python-code-example/', }, { from: '/Code_Examples/SMTP_API_Header_Examples/ruby.html', to: '/for-developers/sending-email/smtp-ruby-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/go.html', to: '/for-developers/sending-email/v2-go-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/java.html', to: '/for-developers/sending-email/v2-java-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/nodejs.html', to: '/for-developers/sending-email/v2-nodejs-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/perl.html', to: '/for-developers/sending-email/v2-perl-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/python.html', to: '/for-developers/sending-email/v2-python-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/ruby.html', to: '/for-developers/sending-email/v2-ruby-code-example/', }, { from: '/Classroom/Basics/password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Deliver/warming_up_ips.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Send/api_keys.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/Classroom/Deliver/Undeliverable_Email/how_sendgrid_handles_550_requested_action_not_taken_mailbox_unavailable_bounces.html', to: '/ui/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Troubleshooting/your_account_is_still_being_provisioned_you_may_not_be_able_to_send_emails.html', to: '/Classroom/Troubleshooting/Account_Administration/your_account_is_still_being_provisioned_you_will_not_be_able_to_send_out_any_email/', }, { from: '/Classroom/Basics/Security/two_factor_authentication_faq.html', to: '/ui/account-and-settings/two_factor_authentication/', }, { from: '/Classroom/Basics/a_sendgrid_user_is_spamming_me.html', to: '/report-spam/', }, { from: '/Classroom/Basics/does_sendgrid_support_end_to_end_tls.html', to: '/ui/sending-email/tls/', }, { from: '/Classroom/Basics/email_flow.html', to: '/ui/sending-email/email-flow/', }, { from: '/Classroom/Basics/everything_about_dmarc.html', to: '/ui/sending-email/dmarc/', }, { from: '/Classroom/Basics/link_shorteners.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/recommended_smtp_settings.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/Classroom/Basics/sendgrid_multiauth_multiple_account_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/sendgrid_oem_process.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/sending_practices.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/smtp_ports.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/Classroom/Basics/ssl_vs_tls.html', to: '/ui/sending-email/ssl-vs-tls/', }, { from: '/Classroom/Basics/tips_to_keep_your_list_organized.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Basics/what_are_subusers.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/what_are_the_sendgrid_apis_and_what_do_they_do.html', to: '/for-developers/sending-email/api-sending-email/', }, { from: '/Classroom/Basics/what_is_smtp.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/Classroom/Basics/what_is_the_difference_between_marketing_and_transactional_emails.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/where_can_i_enable_subscription_tracking.html', to: '/ui/analytics-and-reporting/subuscription-tracking/', }, { from: '/Classroom/Basics/why_are_the_pro_plans_recommended_above_all_others.html', to: '/pricing/', }, { from: '/Classroom/Basics/your_reputation_what_is_it.html', to: 'https://sendgrid.com/blog/what-is-a-domain-reputation/', }, { from: '/Classroom/Basics/Security/setting_up_2_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/', }, { from: '/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html', to: '/ui/account-and-settings/dedicated-ip-addresses/', }, { from: '/Classroom/Basics/Account/creating_multiple_user_credentials_for_sub_users.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Account/im_a_multiple_credential_user_and_i_need_to_reset_my_password.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Account/what_is_my_sending_originating_ip_address_with_sendgrid.html', to: '/ui/account-and-settings/dedicated-ip-addresses/', }, { from: '/Classroom/Basics/Security/sendgrid_multiauth_multiple_account_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Security/what_security_measures_are_available_with_sendgrid_accounts.html', to: '/', gone: true, }, { from: '/Classroom/Basics/Marketing_Campaigns/migration_guide_part_1_migrating_your_recipient_lists_into_contacts.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migration_guide_part_2_importing_your_unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migration_guide_part_3_moving_your_content.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Misc/where_can_i_enable_subscription_tracking.html', to: '/ui/account-and-settings/tracking/#-Subscription-Tracking', }, { from: '/Classroom/Basics/marketing_campaigns_video_tutorials.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Marketing_Campaigns/remove_bounced_addresses.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Basics/Account/account_sign_up_faq.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Basics/Account/how_do_i_add_more_emails_to_my_account.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Basics/Account/how_do_i_reset_my_password.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Basics/Account/why_cant_I_reset_my_password_if_my_account_is_not_provisioned.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Basics/index.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Basics/Inbound_Parse_Webhook/setting_up_the_inbound_parse_webhook.html', to: '/for-developers/parsing-email/setting-up-the-inbound-parse-webhook/', }, { from: '/Classroom/Basics/Marketing_Campaigns/index.html', to: '/ui/account-and-settings/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Marketing_Campaigns/marketing_campaigns_faqs.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Marketing_Campaigns/default_mc_tags.html', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/Classroom/Basics/Marketing_Campaigns/unsubscribe_groups.html', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/Classroom/Basics/Marketing_Campaigns/engagement_stats.html', to: '/ui/analytics-and-reporting/marketing-campaigns-stats/', }, { from: '/Classroom/Basics/Marketing_Campaigns/third_party_partner_marketing_campaigns_access.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Integrate/how_to_integrate_with_mailpoet.html', to: '/for-developers/sending-email/mailpoet/', }, { from: '/Classroom/Basics/Integrate/interspire_integration.html', to: '/for-developers/sending-email/interspire/', }, { from: '/Classroom/Basics/Integrate/sugarcrm_integration.html', to: '/for-developers/sending-email/sugarcrm/', }, { from: '/Classroom/Basics/Misc/support.html', to: '/ui/account-and-settings/support/', }, { from: '/Classroom/Basics/Misc/sendgrid_oem_process.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/Misc/what_is_the_difference_between_marketing_and_transactional_emails.html', to: '/glossary/transactional-email/', }, { from: '/Classroom/Basics/Misc/a_sendgrid_user_is_spamming_me.html', to: '/ui/account-and-settings/support/', }, { from: '/Classroom/Basics/Email_Infrastructure/email_flow.html', to: '/ui/sending-email/email-flow/', }, { from: '/Classroom/Basics/Email_Infrastructure/everything_about_dmarc.html', to: '/ui/sending-email/dmarc/', }, { from: '/Classroom/Basics/Email_Infrastructure/does_sendgrid_support_end_to_end_tls.html', to: '/ui/sending-email/tls/', }, { from: '/Classroom/Basics/API/cors.html', to: '/for-developers/sending-email/cors/', }, { from: '/Classroom/Basics/API/does_sendgrid_offer_a_sandbox_or_test_environment.html', to: '/for-developers/sending-email/sandbox-mode/', }, { from: '/Classroom/Basics/API/how_do_i_integrate_with_sendgrid.html', to: '/for-developers/sending-email/api-getting-started/', }, { from: '/Classroom/Basics/API/how_to_create_a_subuser_with_the_api.html', to: '/for-developers/sending-email/how-to-create-a-subuser-with-the-api/', }, { from: '/Classroom/Basics/API/what_are_the_sendgrid_apis_and_what_do_they_do.html', to: '/for-developers/sending-email/api-getting-started/', }, { from: '/Classroom/Basics/API/what_is_my_api_key.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/Classroom/index.html', to: '/', }, { from: '/Classroom/Build/a_b_testing.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/Classroom/Build/adaptive_email_content.html', to: 'https://sendgrid.com/blog/create-more-personalized-email-content-and-turn-engagement-into-revenue/', }, { from: '/Classroom/Build/attachments.html', to: '/ui/sending-email/attachments-with-digioh/', }, { from: '/Classroom/Build/brand_consistency_why_its_important.html', to: 'https://sendgrid.com/blog/how-to-maintain-brand-standards-in-your-email-designs/', }, { from: '/Classroom/Build/can_i_use_substitution_tags_in_subject_lines.html', to: '/ui/sending-email/substitution-and-section-tags/', }, { from: '/Classroom/Build/content_delivery_networks.html', to: '/ui/sending-email/content-delivery-networks/', }, { from: '/Classroom/Build/embedding_videos_in_your_emails.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/gmail_promotions_tab.html', to: 'https://sendgrid.com/blog/i-fought-the-tabs-and-the-tabs-won/', }, { from: '/Classroom/Build/how_do_i_add_a_list_unsubscribe_header_to_my_emails.html', to: '/ui/sending-email/index-suppressions/', }, { from: 'Classroom/Build/html_formatting_issues.html', to: '/ui/sending-email/formatting-html/', }, { from: '/Classroom/Build/html_rendering__the_dos_and_donts_of_cross_platform_email_design.html', to: '/ui/sending-email/cross-platform-html-design/', }, { from: '/Classroom/Build/personalization_making_your_messages_count.html', to: 'https://sendgrid.com/blog/create-more-personalized-email-content-and-turn-engagement-into-revenue/', }, { from: '/Classroom/Build/plain_text_emails_converted_to_html.html', to: '/ui/sending-email/formatting-html/', }, { from: '/Classroom/Build/responsive_templates_and_design.html', to: '/ui/sending-email/cross-platform-html-design/', }, { from: '/Classroom/Build/substitution_and_section_tags.html', to: '/ui/sending-email/substitution-and-section-tags/', }, { from: '/Classroom/Build/whats_the_recommended_message_size_limit.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/Format_Content/responsive_templates_and_design.html', to: '/ui/sending-email/cross-platform-html-design/', }, { from: '/Classroom/Build/Choose_Content/a_b_testing.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/Classroom/Build/Add_Content/can_i_use_substitution_tags_in_subject_lines.html', to: '/ui/sending-email/editor/', }, { from: '/Classroom/Build/Add_Content/change_email_content_after_send.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/Add_Content/content_delivery_networks.html', to: '/ui/sending-email/content-delivery-networks/', }, { from: '/Classroom/Build/Add_Content/custom_ssl_configurations.html', to: '/ui/account-and-settings/custom-ssl-configurations/', }, { from: '/Classroom/Build/Add_Content/substitution_and_section_tags.html', to: '/ui/sending-email/substitution-and-section-tags/', }, { from: '/Classroom/Build/Add_Content/embedding_videos_in_your_emails.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/Add_Content/how_do_i_add_a_list_unsubscribe_header_to_my_emails.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Build/Add_Content/link_shorteners.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/Add_Content/universal_links.html', to: '/ui/sending-email/universal-links/', }, { from: '/Classroom/Build/Add_Content/whats_the_recommended_message_size_limit.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Build/Add_Content/attachments.html', to: '/ui/sending-email/attachments-with-digioh/', }, { from: '/Classroom/Build/Choose_Content/adaptive_email_content.html', to: 'https://sendgrid.com/blog/create-more-personalized-email-content-and-turn-engagement-into-revenue/', }, { from: '/Classroom/Build/Choose_Content/brand_consistency_why_its_important.html', to: 'https://sendgrid.com/blog/how-to-maintain-brand-standards-in-your-email-designs/', }, { from: '/Classroom/Build/Choose_Content/personalization_making_your_messages_count.html', to: 'https://sendgrid.com/blog/create-more-personalized-email-content-and-turn-engagement-into-revenue/', }, { from: '/Classroom/Build/Format_Content/html_formatting_issues.html', to: '/ui/sending-email/formatting-html/', }, { from: '/Classroom/Build/Format_Content/html_rendering__the_dos_and_donts_of_cross_platform_email_design.html', to: '/ui/sending-email/cross-platform-html-design/', }, { from: '/Classroom/Build/Format_Content/plain_text_emails_converted_to_html.html', to: '/ui/sending-email/cross-platform-html-design/', }, { from: '/Classroom/Build/index.html', to: '/ui/sending-email/editor/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/api_keys.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/Classroom/Deliver/overview.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/all_you_need_to_know_about_whitelabeling.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/ ', }, { from: '/Classroom/Deliver/bacn_its_whats_for_dinner.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/creating_and_whitelabeling_a_subuser_to_a_new_sending_domain.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Deliver/email_deliverability_101.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Delivery_Introduction/how_to_warm_up_your_ip_address.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Deliver/how_to_warm_up_your_ip_address.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Deliver/keep_in_touch_the_importance_of_engagement.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/sendgrids_recommended_sending_practices_and_methods.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/whitelabel_do_i_need_to_make_dns_changes_pro_and_higher.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/Classroom/Deliver/suppressions_vs_unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Deliver/the_art_of_notifications.html', to: '/ui/account-and-settings/notifications/', }, { from: '/Classroom/Deliver/russian_data_localization_law.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/unsubscribes_explained.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Deliver/affiliate_lists_and_list_sharing.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/let_old_addresses_sleep_in_peace.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/list_scrubbing_guide.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/list_scrubbing.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/peer_initiated_email_invitation_requirements.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/preference_centers_giving_subscribers_control.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/role_addresses.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/tips_to_keep_your_list_organized.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/where_did_you_get_my_address_permission_reminders.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/why_purchase_lists_when_you_can.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/why_purchased_email_lists_are_no_good.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Deliver/aol_dmarc_changes_refused_due_to_provided_dmarc_policy.html', to: '/ui/account-and-settings/aol-dmarc/', }, { from: '/Classroom/Deliver/dkim_settings_for_whitelabel_pro100k_and_higher.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/ ', }, { from: '/Classroom/Deliver/Sender_Authentication/dkim_settings_for_whitelabel_pro100k_and_higher.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/ ', }, { from: '/Classroom/Deliver/gmail_dmarc_changes.html', to: '/ui/account-and-settings/gmail-dmarc/', }, { from: '/Classroom/Deliver/internet_standards_spf_and_dkim_and_deliverability.html', to: '/ui/account-and-settings/spf-dkim/', }, { from: '/Classroom/Deliver/spf_dont_exceed_ten_dns_lookups.html', to: '/ui/account-and-settings/spf-dkim/', }, { from: '/Classroom/Deliver/spf_records_explained.html', to: '/ui/account-and-settings/spf-records/', }, { from: '/Classroom/Deliver/the_importance_of_a_physical_mailing_address.html', to: '/ui/sending-email/senders/', }, { from: '/Classroom/Deliver/yahoo_dmarc_changes_message_not_accepted_for_policy_reasons.html', to: '/ui/account-and-settings/yahoo-dmarc/', }, { from: '/Classroom/Deliver/google_feedback_loop_spam_complaints.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/ui_my_emails_arent_being_delivered.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/how_can_i_guarantee_my_emails_arrive_in_my_recipients_inbox.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/how_do_i_keep_emails_from_dropping.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/how_sendgrid_handles_550_requested_action_not_taken_mailbox_unavailable_bounces.html', to: '/ui/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Deliver/my_emails_are_being_blocked.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/my_emails_are_being_dropped.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/my_emails_are_going_to_spam.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Delivery_Introduction/overview.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/spam_trapped.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/what_do_i_do_if_im_blacklisted.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/enabling_custom_dkim.html', to: '/ui/account-and-settings/spf-dkim/', }, { from: '/Classroom/Deliver/Delivery_Introduction/sendgrids_recommended_sending_practices_and_methods.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Undeliverable_Email/how_can_i_guarantee_my_emails_arrive_in_my_recipients_inbox.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Undeliverable_Email/my_emails_are_being_blocked.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Address_Lists/why_purchase_lists_when_you_can.html', to: 'https://sendgrid.com/blog/buying-email-lists-3-reasons-why-you-shouldnt/', }, { from: '/Classroom/Deliver/Delivery_Introduction/bacn_its_whats_for_dinner.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Delivery_Introduction/IP_reputation_montoring.html', to: '/ui/account-and-settings/dedicated-ip-addresses/', }, { from: '/Classroom/Deliver/Delivery_Introduction/email_deliverability_101.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Delivery_Introduction/russian_data_localization_law.html', to: '/glossary/gdpr/', }, { from: '/Classroom/Deliver/Delivery_Introduction/suppressions_vs_unsubscribes.html', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/Classroom/Deliver/Delivery_Introduction/the_art_of_notifications.html', to: '/ui/account-and-settings/notifications/', }, { from: '/Classroom/Deliver/Delivery_Introduction/unsubscribes_explained.html', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/Classroom/Deliver/index.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/shared_ip_throttling.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Sender_Authentication/gmail_dmarc_changes.html', to: '/ui/account-and-settings/gmail-dmarc/', }, { from: '/Classroom/Deliver/Sender_Authentication/aol_dmarc_changes_refused_due_to_provided_dmarc_policy.html', to: '/ui/account-and-settings/aol-dmarc/', }, { from: '/Classroom/Deliver/Sender_Authentication/microsoft_dmarc_changes.html', to: '/ui/account-and-settings/microsoft-dmarc/', }, { from: '/Classroom/Deliver/Sender_Authentication/yahoo_dmarc_changes_message_not_accepted_for_policy_reasons.html', to: '/ui/account-and-settings/yahoo-dmarc/', }, { from: '/Classroom/Deliver/Sender_Authentication/spf_records_explained.html', to: '/ui/account-and-settings/spf-records/', }, { from: '/Classroom/Deliver/Sender_Authentication/spf_dont_exceed_ten_dns_lookups.html', to: '/ui/account-and-settings/spf-limitations/', }, { from: '/Classroom/Deliver/Sender_Authentication/the_importance_of_a_physical_mailing_address.html', to: '/ui/sending-email/senders/', }, { from: '/Classroom/Deliver/Sender_Authentication/internet_standards_spf_and_dkim_and_deliverability.html', to: '/ui/account-and-settings/spf-dkim/', }, { from: '/Classroom/Deliver/Sender_Authentication/help_my_emails_arent_being_delivered.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Deliver/Sender_Authentication/how_do_i_keep_emails_from_dropping.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Deliver/Sender_Authentication/my_emails_are_being_dropped.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Deliver/Sender_Authentication/my_emails_are_going_to_spam.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Deliver/Sender_Authentication/what_do_i_do_if_im_blacklisted.html', to: '/ui/sending-email/blacklists/', }, { from: '/Classroom/Deliver/Sender_Authentication/spam_trapped.html', to: '/ui/sending-email/spam-traps/', }, { from: '/Classroom/Deliver/Sender_Authentication/google_feedback_loop_spam_complaints.html', to: '/ui/sending-email/spam/', }, { from: '/Classroom/Deliver/Sender_Authentication/why_is_sendgrid_net_greylisted.html', to: '/ui/sending-email/sendgrid.net-greylisted/', }, { from: '/Classroom/Send/how_can_i_schedule_emails_to_send_at_specific_times.html', to: '/for-developers/sending-email/scheduling-email/', }, { from: '/Classroom/Send/seeing_a_delay_with_your_first_few_sends.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Send/can_i_stop_a_send_in_progress.html', to: '/for-developers/sending-email/stopping-an-in-progress-send/ ', }, { from: '/Classroom/Send/can_i_send_from_multiple_domains.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Send/can_i_send_from_multiple_from_addresses.html', to: '/ui/sending-email/senders/', }, { from: '/Classroom/Send/email_to_sms.html', to: '/ui/sending-email/email-to-sms/', }, { from: '/Classroom/Send/how_do_i_send_mail_through_subuser_accounts.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Send/sendmail_relay_all_local_mail_through_sendgrid.html', to: '/ui/sending-email/sendmail/', }, { from: '/Classroom/Send/sending.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Send/can_i_resend_messages_that_were_dropped.html', to: '/ui/sending-email/drops/', }, { from: '/Classroom/Send/can_i_send_adult_content_in_my_emails.html', to: '/ui/sending-email/can-i-send-adult-content-in-my-emails/', }, { from: '/Classroom/Send/can_i_send_to_purchased_lists.html', to: 'https://sendgrid.com/blog/buying-email-lists-3-reasons-why-you-shouldnt/', }, { from: '/Classroom/Send/welcome_emails_making_a_good_first_impression.html', to: 'https://sendgrid.com/blog/how-to-send-the-perfect-welcome-email/', }, { from: '/Classroom/Send/resubscription_of_users.html', to: '/ui/sending-email/recipient-subscription-preferences/', }, { from: '/Classroom/Send/segmenting_traffic.html', to: '/ui/managing-contacts/segmenting-your-contacts/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/resubscription_of_users.html', to: '/ui/sending-email/recipient-subscription-preferences/ ', }, { from: '/Classroom/Send/How_Emails_Are_Sent/can_i_send_from_multiple_domains.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/can_i_send_from_multiple_from_addresses.html', to: '/ui/sending-email/senders/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/email_to_sms.html', to: '/ui/sending-email/email-to-sms/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/sendmail_relay_all_local_mail_through_sendgrid.html', to: '/for-developers/sending-email/sendmail/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/unauthenticated_sender.html', to: '/for-developers/sending-email/getting-started-smtp/', }, { from: '/Classroom/Send/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html', to: '/for-developers/sending-email/migrating-from-v2-to-v3-mail-send/', }, { from: '/Classroom/Send/v3_Mail_Send/personalizations.html', to: '/for-developers/sending-email/personalizations/', }, { from: '/Classroom/Send/v3_Mail_Send/sandbox_mode.html', to: '/for-developers/sending-email/sandbox-mode/', }, { from: '/Classroom/Send/v3_Mail_Send/v3_mail_send_faq.html', to: '/for-developers/sending-email/v3-mail-send-faq/', }, { from: '/Classroom/Send/What_You_Can_Send/can_i_send_adult_content_in_my_emails.html', to: '/ui/sending-email/deliverability/#sending-adult-content', }, { from: '/Classroom/Send/What_You_Can_Send/welcome_emails_making_a_good_first_impression.html', to: 'https://sendgrid.com/blog/how-to-send-the-perfect-welcome-email/', }, { from: '/Classroom/Send/When_Emails_Are_Sent/can_i_stop_a_scheduled_send.html', to: '/for-developers/sending-email/stopping-a-scheduled-send/', }, { from: '/Classroom/Send/When_Emails_Are_Sent/can_i_stop_a_send_in_progress.html', to: '/for-developers/sending-email/stopping-an-in-progress-send/ ', }, { from: '/Classroom/Send/When_Emails_Are_Sent/how_can_i_schedule_emails_to_send_at_specific_times.html', to: '/for-developers/sending-email/scheduling-email/', }, { from: '/Classroom/Send/When_Emails_Are_Sent/seeing_a_delay_with_your_first_few_sends.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Track/what_do_all_these_delivery_statistics_mean.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/Classroom/Track/discrepancies_between_requests_and_deliveries.html', to: '/ui/sending-email/email-activity-feed ', }, { from: '/Classroom/Track/can_i_download_a_list_of_click_and_or_open_events.html', to: '/ui/sending-email/email-activity-feed ', }, { from: '/Classroom/Track/how_can_i_tell_if_an_email_was_actually_delivered.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/google_analytics_demystified_ga_statistics_vs_sg_statistics.html', to: '/ui/analytics-and-reporting/google-analytics ', }, { from: '/Classroom/Track/new_relic.html', to: '/ui/analytics-and-reporting/tracking-stats-using-new-relic ', }, { from: '/Classroom/Track/is_there_a_way_to_see_the_content_of_transactional_emails_i_send.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/Classroom/Track/bounce_forwarding_and_gmail.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/bounce_reports_how_can_i_be_notified.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/common_smtp_server_bounce_responses.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Track/delete_from_bounce_list_option_in_email_activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/implementing_bounce_notification_for_multiple_from_addresses.html', to: '/ui/sending-email/bounces/', }, { from: '/Classroom/Track/click_tracking_html_best_practices.html', to: '/ui/analytics-and-reporting/click-tracking-html-best-practices/', }, { from: '/Classroom/Track/clicktracking_ssl.html', to: '/ui/analytics-and-reporting/clicktracking-ssl ', }, { from: '/Classroom/Track/delivery_rate_drops_rate.html', to: '/ui/sending-email/drops/', }, { from: '/Classroom/Track/drop_reason_unsubscribed_address.html', to: '/ui/sending-email/drops/', }, { from: '/Classroom/Track/how_to_set_up_bounce_forwarding_to_go_to_the_emails_from_address.html', to: '/ui/sending-email/bounces/#-Bounce-Notifications', }, { from: '/Classroom/Track/how_to_set_up_bounce_forwarding.html', to: '/ui/sending-email/bounces/#-Bounce-Notifications', }, { from: '/Classroom/Track/click_tracking_links_have_stopped_working.html', to: '/ui/analytics-and-reporting/click-tracking/', }, { from: '/Classroom/Track/drop_reason_bounced_address.html', to: '/for-developers/sending-email/smtp-filters/#bypass_list_management', }, { from: '/Classroom/Track/how_do_i_unsubscribe_a_user.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Track/unsubscribe_via_subscription_tracking.html', to: '/ui/analytics-and-reporting/subscription-tracking/', }, { from: '/Classroom/Track/Introduction/what_do_all_these_delivery_statistics_mean.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/Classroom/Track/unsubscribe_via_the_subscription_tracking.html', to: '/ui/analytics-and-reporting/subscription-tracking/', }, { from: '/Classroom/Track/index.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/Classroom/Track/Collecting_Data/a_guide_for_tracking_data_with_keen_io.html', to: '/ui/analytics-and-reporting/tracking-data-with-keen-io/', }, { from: '/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html', to: '/ui/analytics-and-reporting/google-analytics/', }, { from: '/Classroom/Track/Collecting_Data/is_there_a_way_to_see_the_content_of_transactional_emails_i_send.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/Classroom/Track/Collecting_Data/new_relic.html', to: '/ui/analytics-and-reporting/tracking-stats-using-new-relic/', }, { from: '/Classroom/Track/Clicks/click_tracking_links_with_substitution_tags.html', to: '/ui/analytics-and-reporting/marketing-campaigns-stats/', }, { from: '/Classroom/Track/Clicks/click_tracking_html_best_practices.html', to: '/ui/analytics-and-reporting/click-tracking-html-best-practices/', }, { from: '/Classroom/Track/Clicks/click_tracking_links_have_stopped_working.html', to: '/ui/analytics-and-reporting/click-tracking-html-best-practices/', }, { from: '/Classroom/Track/Clicks/clicktracking_ssl.html', to: '/ui/analytics-and-reporting/click-tracking-ssl/', }, { from: '/Classroom/Track/Unsubscribes/how_do_i_unsubscribe_a_user.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Classroom/Track/Unsubscribes/list_unsubscribe.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/Classroom/Track/Unsubscribes/unsubscribe_via_subscription_tracking.html', to: '/ui/sending-email/subscription-tracking/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_can_i_turn_off_2_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/', }, { from: '/Classroom/Troubleshooting/Account_Administration/your_account_is_still_being_provisioned_you_will_not_be_able_to_send_any_email.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/account_under_review_suspended.html', to: '/ui/account-and-settings/account-under-review/', }, { from: '/Classroom/Troubleshooting/cant_access_the_email_address_on_file_for_your_sendgrid_account.html', to: '/ui/account-and-settings/accessing-email-account-associated-with-sendgrid/', }, { from: '/Classroom/Troubleshooting/cant_log_in_to_your_account.html', to: '/ui/account-and-settings/log-in-issues/', }, { from: '/Classroom/Troubleshooting/dont_know_your_user_name.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Troubleshooting/help_i_cant_find_my_smtp_username_and_password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Troubleshooting/help_my_account_has_been_compromised.html', to: '/ui/account-and-settings/account-compromised/', }, { from: '/Classroom/Troubleshooting/heroku_users_find_your_sendgrid_credentials.html', to: '/ui/account-and-settings/heroku-credentials ', }, { from: '/Classroom/Troubleshooting/how_can_i_turn_off_2_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/', }, { from: '/Classroom/Troubleshooting/how_to_change_password_when_integrated_via_appdirect.html', to: '/ui/account-and-settings/password-reset-appdirect/', }, { from: '/Classroom/Troubleshooting/how_to_change_the_password_for_your_sendgrid_account_via_softlayer.html', to: '/ui/account-and-settings/password-reset-softlayer/', }, { from: '/Classroom/Troubleshooting/how_to_change_the_password_for_your_sendgrid_add_on_via_azure.html', to: '/ui/account-and-settings/password-reset-azure/', }, { from: '/Classroom/Troubleshooting/how_to_change_the_password_for_your_sendgrid_add_on_via_openshift.html', to: '/ui/account-and-settings/password-reset-openshift/', }, { from: '/Classroom/Troubleshooting/how_to_change_the_password_for_your_sendgrid_add_on_via_the_ibm_cloud_marketplace.html', to: '/ui/account-and-settings/password-reset-ibm-cloud-marketplace/', }, { from: '/Classroom/Troubleshooting/i_didnt_receive_the_password_reset_email.html', to: '/ui/account-and-settings/password-reset-email/', }, { from: '/Classroom/Troubleshooting/my_provision_was_declined_what_should_i_do.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/you_cannot_change_your_package_at_this_time_because_your_account_is_not_active.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/your_account_is_still_being_provisioned_you_may_not_be_able_to_send_out_any_email.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/your_account_is_still_being_provisioned_you_will_not_be_able_to_send_out_any_email.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/your_sendgrid_account_is_at_risk_for_suspension_what_should_i_do.html', to: '/ui/account-and-settings/account-under-review/', }, { from: '/Classroom/Troubleshooting/email_was_deferred_due_to_the_following_reasons_ip_deferrals_messages.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Troubleshooting/emails_are_being_sent_multiple_times.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/my_client_is_complaining_that_they_have_not_received_an_email.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Troubleshooting/testing_your_connectivity_to_sendgrids_smtp_relay_usinng_telnet.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/Classroom/Troubleshooting/troubleshooting_delays_and_latency.html', to: '/ui/account-and-settings/safely-test-your-sending-speed/', }, { from: '/Classroom/Troubleshooting/a_custom_field_did_not_substitute_during_a_send.html', to: '/ui/managing-contacts/custom-fields/', }, { from: '/Classroom/Troubleshooting/certificate_verification_failed.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Troubleshooting/dns_records_and_underscores.html', to: '/ui/sending-email/troubleshooting/', }, { from: '/Classroom/Troubleshooting/how_do_i_check_the_headers_raw_source_of_an_email.html', to: '/ui/account-and-settings/checking-email-source/', }, { from: '/Classroom/Troubleshooting/i_have_created_dns_records_but_the_whitelabel_wizard_is_not_validating_them.html', to: '/ui/account-and-settings/troubleshooting-sender-authentication/', }, { from: '/Classroom/Troubleshooting/invalid_smtp_api_header.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Troubleshooting/list_upload_troubleshooting.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/Classroom/Troubleshooting/my_emails_are_displaying_as_on_behalf_of_or_via_in_some_mail_clients.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/upgrading_your_whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/you_have_used_a_reserved_field_name_for_your_custom_field.html', to: '/ui/managing-contacts/custom-fields/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/email_was_deferred_due_to_the_following_reasons_ip_deferrals_messages.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Classroom/Troubleshooting/Account_Administration/account_under_review_suspended.html', to: '/ui/account-and-settings/account-under-review/', }, { from: '/Classroom/Troubleshooting/Account_Administration/cant_access_the_email_address_on_file_for_your_sendgrid_account.html', to: '/ui/account-and-settings/accessing-email-account-associated-with-sendgrid/', }, { from: '/Classroom/Troubleshooting/Account_Administration/cant_log_in_to_your_account.html', to: '/ui/account-and-settings/log-in-issues/', }, { from: '/Classroom/Troubleshooting/Account_Administration/help_i_cant_find_my_smtp_username_and_password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Troubleshooting/Account_Administration/help_my_account_has_been_compromised.html', to: '/ui/account-and-settings/account-compromised/', }, { from: '/Classroom/Troubleshooting/Account_Administration/heroku_users_find_your_sendgrid_credentials.html', to: '/ui/account-and-settings/heroku-credentials/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_to_change_password_when_integrated_via_appdirect.html', to: '/ui/account-and-settings/password-reset-appdirect/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_to_change_the_password_for_your_sendgrid_account_via_softlayer.html', to: '/ui/account-and-settings/password-reset-softlayer/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_to_change_the_password_for_your_sendgrid_add_on_via_azure.html', to: '/ui/account-and-settings/password-reset-azure/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_to_change_the_password_for_your_sendgrid_add_on_via_openshift.html', to: '/ui/account-and-settings/password-reset-openshift/', }, { from: '/Classroom/Troubleshooting/Account_Administration/how_to_change_the_password_for_your_sendgrid_add_on_via_the_ibm_cloud_marketplace.html', to: '/ui/account-and-settings/password-reset-ibm-cloud-marketplace/', }, { from: '/Classroom/Troubleshooting/Account_Administration/ip_access_management_has_locked_me_out_of_my_account.html', to: '/ui/account-and-settings/ip-access-management/', }, { from: '/Classroom/Troubleshooting/Account_Administration/i_didnt_receive_the_password_reset_email.html', to: '/ui/account-and-settings/password-reset-email/', }, { from: '/Classroom/Troubleshooting/Account_Administration/my_provision_was_declined_what_should_i_do.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/Account_Administration/you_cannot_change_your_package_at_this_time_because_your_account_is_not_active.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/index.html', to: '/ui/account-and-settings/account/', }, { from: '/Classroom/Troubleshooting/Authentication/how_do_i_check_the_headers_raw_source_of_an_email.html', to: '/ui/sending-email/checking-email-source/', }, { from: '/Classroom/Troubleshooting/Authentication/my_emails_are_displaying_as_on_behalf_of_or_via_in_some_mail_clients.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/safely_test_your_sending_speed.html', to: '/ui/account-and-settings/safely-test-your-sending-speed/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/troubleshooting_delays_and_latency.html', to: '/ui/account-and-settings/troubleshooting-delays-and-latency ', }, { from: '/Delivery_Metrics/index.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/Delivery_Metrics/advanced_statistics.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/Delivery_Metrics/alerts.html', to: '/ui/account-and-settings/alerts/', }, { from: '/Delivery_Metrics/categories.html', to: '/ui/analytics-and-reporting/categories/', }, { from: '/Delivery_Metrics/email_activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Delivery_Metrics/email_reports.html', to: '/ui/account-and-settings/alerts/', }, { from: '/Glossary/Email_Types/peer_invitations.html', to: '/glossary/peer-invitations/', }, { from: '/Glossary/ip_whitelabeling.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/Glossary/bulk_sender_notification.html', to: '/glossary/', }, { from: '/Glossary/provisioning.html', to: '/ui/account-and-settings/account/', }, { from: '/Glossary/marketing_email.html', to: '/glossary/email-marketing/', }, { from: '/Glossary/email_error_messages.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Glossary/sender_reputation.html', to: 'https://sendgrid.com/blog/what-is-a-domain-reputation/', }, { from: '/Glossary/triggering_events.html', to: '/glossary/automated-email/', }, { from: '/Integrate/Mail_Clients/outlook_2010.html', to: '/for-developers/sending-email/outlook-2013/', }, { from: '/Integrate/Partners/Tutorials/EngineYard.html', to: '/for-developers/sending-email/engineyard/', }, { from: '/Integrate/Partners/Tutorials/OpenShift.html', to: '/ui/account-and-settings/password-reset-openshift/', }, { from: '/Integrate/Partners/Tutorials/WindowsAzure.html', to: '/for-developers/partners/microsoft-azure/', }, { from: '/Integrate/Tutorials/segment/sendgrid_source.html', to: '/', }, { from: '/Integrate/Open_Source_Apps/wordpress.html', to: '/for-developers/sending-email/wordpress-faq/', }, { from: '/Integrate/libraries.html', to: '/for-developers/sending-email/libraries/', }, { from: '/Integrate/index.html', to: '/for-developers/sending-email/', }, { from: '/Integrate/Tutorials/analytics_with_keen_io.html', to: '/for-developers/tracking-events/analytics-with-keen-io/', }, { from: '/Integrate/Tutorials/BriteVerify.html', to: '/for-developers/sending-email/brite-verify/', }, { from: '/Integrate/Tutorials/Formio.html', to: '/for-developers/sending-email/formio/', }, { from: '/Integrate/Tutorials/CloudRail.html', to: '/for-developers/sending-email/cloud-rail/', }, { from: '/Integrate/Tutorials/OpenShift.html', to: '/ui/account-and-settings/password-reset-openshift/', }, { from: '/Integrate/Tutorials/WindowsAzure.html', to: '/for-developers/partners/azure/', }, { from: '/Integrate/Tutorials/event_kit.html', to: '/for-developers/tracking-events/event-kit/', }, { from: '/Integrate/Tutorials/Segment/sendgrid_source.html', to: '/for-developers/tracking-events/segment-sendgrid-source/', }, { from: '/Integrate/Tutorials/WordPress/index.html', to: '/for-developers/sending-email/wordpress-faq/', }, { from: '/Integrate/Tutorials/WordPress/wordpress_integration_faq.html', to: '/for-developers/sending-email/wordpress-faq/', }, { from: '/Integrate/Tutorials/WordPress/sendgrid_wordpress_plugin.html', to: '/for-developers/sending-email/wordpress-plugin/', }, { from: '/Integrate/Tutorials/WordPress/subscription_widget.html', to: '/for-developers/sending-email/wordpress-subscription-widget/', }, { from: '/Integrate/Tutorials/Zapier/sending_for_gravity_forms_submissions.html', to: '/for-developers/sending-email/zapier-sending-for-gravity-forms-submissions/', }, { from: '/Integrate/Tutorials/Zapier/sending_for_new_webhook_data.html', to: '/for-developers/sending-email/zapier-sending-for-new-webhook-data/', }, { from: '/Integrate/Tutorials/Zapier/sending_for_postgre_sql_row_matches.html', to: '/for-developers/sending-email/zapier-sending-for-postgre-sql-row-matches/', }, { from: '/Integrate/Tutorials/Zapier/sending_from_google_sheet_rows.html', to: '/for-developers/sending-email/zapier-sending-from-google-sheet-rows/', }, { from: '/Integrate/Tutorials/Zapier/sending_to_tagged_infusionsoft_contacts.html', to: '/for-developers/sending-email/zapier-sending-to-tagged-infusionsoft-contacts/', }, { from: '/Integrate/Tutorials/Zapier/sending_when_new_firebase_child_records_added.html', to: '/for-developers/sending-email/zapier-sending-when-new-firebase-child-records-added/', }, { from: '/Integrate/Mail_Clients/applemail.html', to: '/for-developers/sending-email/applemail/', }, { from: '/Integrate/Mail_Clients/outlook_2013.html', to: '/for-developers/sending-email/outlook-2013/', }, { from: '/Integrate/Mail_Clients/outlook.html', to: '/for-developers/sending-email/outlook/', }, { from: '/Integrate/Mail_Clients/thunderbird.html', to: '/for-developers/sending-email/thunderbird/', }, { from: '/Integrate/Mail_Clients/index.html', to: '/for-developers/sending-email/applemail/', }, { from: '/Integrate/Partners/Amazon_Marketplace.html', to: '/for-developers/partners/amazon-marketplace/', }, { from: '/Integrate/Partners/Google.html', to: '/for-developers/partners/google/', }, { from: '/Integrate/Partners/magento.html', to: '/for-developers/partners/magento/', }, { from: '/Integrate/Partners/index.html', to: '/for-developers/partners/magento/', }, { from: '/Integrate/Partners/Microsoft_Azure.html', to: '/for-developers/partners/microsoft-azure/', }, { from: '/Integrate/Other/index.html', to: '/for-developers/sending-email/interspire/', }, { from: '/Integrate/Other/interspire.html', to: '/for-developers/sending-email/interspire/', }, { from: '/Integrate/Other/sugarcrm.html', to: '/for-developers/sending-email/sugarcrm/', }, { from: '/Integrate/Open_Source_Apps/magento.html', to: '/for-developers/partners/magento/', }, { from: '/Integrate/Open_Source_Apps/modex.html', to: '/for-developers/sending-email/modex/', }, { from: '/Integrate/Open_Source_Apps/joomla.html', to: '/for-developers/sending-email/joomla/', }, { from: '/Integrate/Open_Source_Apps/index.html', to: '/for-developers/sending-email/joomla/', }, { from: '/Integrate/Open_Source_Apps/drupal.html', to: '/for-developers/sending-email/drupal/', }, { from: '/Integrate/Open_Source_Apps/phpbb.html', to: '/for-developers/sending-email/phpbb/', }, { from: '/Integrate/Mail_Servers/exchange_2010.html', to: '/for-developers/sending-email/exchange-2010/', }, { from: '/Integrate/Mail_Servers/exim.html', to: '/for-developers/sending-email/exim/', }, { from: '/Integrate/Mail_Servers/iis75.html', to: '/for-developers/sending-email/iis75/', }, { from: '/Integrate/Mail_Servers/postfix.html', to: '/for-developers/sending-email/postfix/', }, { from: '/Integrate/Mail_Servers/qmail.html', to: '/for-developers/sending-email/qmail/', }, { from: '/Integrate/Mail_Servers/sendmail.html', to: '/for-developers/sending-email/sendmail/', }, { from: '/Integrate/Mail_Servers/ssmtp.html', to: '/for-developers/sending-email/ssmtp/', }, { from: '/Integrate/Mail_Servers/index.html', to: '/for-developers/sending-email/exim/', }, { from: '/Integrate/Frameworks/cakephp.html', to: '/for-developers/sending-email/cakephp/', }, { from: '/Integrate/Frameworks/codeigniter.html', to: '/for-developers/sending-email/codeigniter/', }, { from: '/Integrate/Frameworks/django.html', to: '/for-developers/sending-email/django/', }, { from: '/Integrate/Frameworks/index.html', to: '/for-developers/sending-email/laravel/', }, { from: '/Integrate/Frameworks/laravel.html', to: '/for-developers/sending-email/laravel/', }, { from: '/Integrate/Frameworks/rubyonrails.html', to: '/for-developers/sending-email/rubyonrails/', }, { from: '/Integrate/Frameworks/symfony.html', to: '/for-developers/sending-email/symfony/', }, { from: '/Integrate/Frameworks/zend.html', to: '/for-developers/sending-email/zend/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/csharp.html', to: '/for-developers/tracking_events/csharp-code-example/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/go.html', to: '/for-developers/tracking_events/go-code-example/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/nodejs.html', to: '/for-developers/tracking_events/nodejs-code-example/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/php.html', to: '/for-developers/tracking_events/php-code-example/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/python.html', to: '/for-developers/tracking_events/python-code-example/', }, { from: '/Integrate/Code_Examples/Webhook_Examples/index.html', to: '/for-developers/tracking_events/nodejs-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/nodejs.html', to: '/for-developers/sending-email/smtp-nodejs-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/go.html', to: '/for-developers/sending-email/smtp-go-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/index.html', to: '/for-developers/sending-email/smtp-nodejs-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/perl.html', to: '/for-developers/sending-email/smtp-perl-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/php.html', to: '/for-developers/sending-email/smtp-php-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/python.html', to: '/for-developers/sending-email/smtp-python-code-example/', }, { from: '/Integrate/Code_Examples/SMTP_API_Header_Examples/ruby.html', to: '/for-developers/sending-email/smtp-ruby-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/csharp.html', to: '/for-developers/sending-email/v2-csharp-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/php.html', to: '/for-developers/sending-email/v2-php-code-example/', }, { from: '/Integrate/Code_Examples/v2_Mail/index.html', to: '/for-developers/sending-email/v2-go-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/csharp.html', to: '/for-developers/sending-email/v3-csharp-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/go.html', to: '/for-developers/sending-email/v3-go-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/java.html', to: '/for-developers/sending-email/v3-java-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/nodejs.html', to: '/for-developers/sending-email/v3-nodejs-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/php.html', to: '/for-developers/sending-email/v3-php-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/python.html', to: '/for-developers/sending-email/v3-python-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/ruby.html', to: '/for-developers/sending-email/v3-ruby-code-example/', }, { from: '/Integrate/Code_Examples/v3_Mail/index.html', to: '/for-developers/sending-email/v3-java-code-example/', }, { from: '/Integrate/Code_Examples/index.html', to: '/for-developers/sending-email/libraries/', }, { from: '/Marketing_Emails/Email_Marketing_Campaigns/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Marketing_Emails/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Marketing_Emails/analytics.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/Marketing_Emails/create_manage.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Marketing_Emails/dashboard.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Marketing_Emails/Email_Marketing_Campaigns/peer_invitations.html', to: '/glossary/peer-invitations/', }, { from: '/Marketing_Emails/Email_Marketing_Campaigns/reconfirmation.html', to: '/glossary/reconfirmation/', }, { from: '/Marketing_Emails/tags.html', to: '/ui/sending-email/editor/', }, { from: '/Marketing_Emails/unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Marketing_Emails/recipients.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/Marketing_Emails/sender_address.html', to: '/ui/sending-email/senders/', }, { from: '/Transactional_Email/index.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/Transactional_Email/unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Transactional_Email/Template_Engine/setup_guide.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/dashboard.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/about.html', to: '/', }, { from: '/User_Guide/Account/api_keys.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/User_Guide/Account/index.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/User_Guide/Account/Account_Settings/global_settings.html', to: '/ui/account-and-settings/mail/', }, { from: '/User_Guide/Account/Account_Settings/index.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Account/Account_Settings/multiple_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/User_Guide/Account/Account_Settings/password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/User_Guide/Account/Account_Settings/profile_settings.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Account/Account_Settings/two_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/ ', }, { from: '/User_Guide/Account/billing_settings.html', to: '/ui/account-and-settings/billing/', }, { from: '/User_Guide/Account/billing_history.html', to: '/ui/account-and-settings/billing/', }, { from: '/User_Guide/Account/billing.html', to: '/ui/account-and-settings/billing/', }, { from: '/User_Guide/Account/alert_settings.html', to: '/ui/account-and-settings/alerts/', }, { from: '/User_Guide/advanced_suppression_manager.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Apps/address_whitelisting.html', to: '/ui/account-and-settings/mail/', }, { from: '/User_Guide/Apps/bcc.html', to: '/ui/account-and-settings/mail/#-BCC', }, { from: '/User_Guide/Apps/bypass_list_management.html', to: '/for-developers/sending-email/smtp-filters #bypass_list_management', }, { from: '/User_Guide/Apps/click_tracking.html', to: '/ui/account-and-settings/tracking #-Click-tracking', }, { from: '/User_Guide/Apps/dkim.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Apps/domain_keys.html', to: '/ui/sending-email/how-to-set-up-domain-whitelabel ', }, { from: '/User_Guide/Apps/email_templates.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Apps/event_notification.html', to: '/ui/account-and-settings/mail/#-Event-Notification', }, { from: '/User_Guide/Apps/footer.html', to: '/ui/account-and-settings/mail/#-Footer', }, { from: '/User_Guide/Apps/forward_spam.html', to: '/ui/account-and-settings/mail/#-Forward-Spam', }, { from: '/User_Guide/Apps/google_analytics.html', to: '/ui/account-and-settings/tracking ', }, { from: '/User_Guide/Apps/index.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Apps/new_relic.html', to: '/ui/account-and-settings/partners #-SendGrid-For-New-Relic', }, { from: '/User_Guide/Apps/open_tracking.html', to: '/ui/account-and-settings/tracking #-Open-Tracking', }, { from: '/User_Guide/Apps/sendwithus.html', to: '/ui/account-and-settings/partners #-sendwithus', }, { from: '/User_Guide/Apps/spam_checker.html', to: '/ui/account-and-settings/mail/#-Spam-Checker', }, { from: '/User_Guide/Apps/subscription_tracking.html', to: '/ui/account-and-settings/tracking #-Subscription-Tracking', }, { from: '/User_Guide/Apps/template_engine.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/attachments.html', to: '/ui/sending-email/attachments-with-digioh ', }, { from: '/User_Guide/billing.html', to: '/ui/account-and-settings/billing/', }, { from: '/User_Guide/clicktracking_ssl.html', to: '/ui/sending-email/content-delivery-networks/', }, { from: '/User_Guide/Delivery_Metrics/advanced_statistics.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/User_Guide/Delivery_Metrics/alerts.html', to: '/ui/account-and-settings/alerts/', }, { from: '/User_Guide/Delivery_Metrics/email_error_messages.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/User_Guide/Delivery_Metrics/email_activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/User_Guide/Delivery_Metrics/email_reports.html', to: '/ui/account-and-settings/alerts/', }, { from: '/User_Guide/Email_Deliverability/attachments.html', to: '/ui/sending-email/attachments-with-digioh ', }, { from: '/User_Guide/Delivery_Metrics/categories.html', to: '/ui/analytics-and-reporting/categories/', }, { from: '/User_Guide/Email_Deliverability/index.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/User_Guide/Email_Deliverability/list_scrubbing.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Delivery_Metrics/metrics.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/User_Guide/Email_Deliverability/scheduling.html', to: '/for-developers/sending-email/scheduling-parameters/', }, { from: '/User_Guide/Email_Deliverability/sender_reputation.html', to: '/glossary/sender-reputation/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/index.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/advanced_suppression_manager.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/defining_asm_groups.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/recipient_subscription_preferences.html', to: '/ui/sending-email/recipient-subscription-preferences/ ', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/suppressions_vs_unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Email_Deliverability/Subscription_Tracking/using_suppression_groups.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/advanced_suppression_manager.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/defining_asm_groups.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/index.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/recipient_subscription_preferences.html', to: '/ui/sending-email/recipient-subscription-preferences/ ', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/resubscription_of_users.html', to: '/ui/sending-email/recipient-subscription-preferences/ ', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/suppressions_vs_unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Email_Deliverability/Suppression_Tracking/using_suppression_groups.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Email_Deliverability/Undelivered_Email/bounce_forwarding.html', to: '/ui/account-and-settings/mail/', }, { from: '/User_Guide/Email_Deliverability/Undelivered_Email/drops.html', to: '/glossary/drops/', }, { from: '/User_Guide/Email_Deliverability/Undelivered_Email/index.html', to: '/glossary/undelivered-email ', }, { from: '/User_Guide/Email_Deliverability/Undelivered_Email/spam.html', to: '/glossary/spam/', }, { from: '/User_Guide/Email_Settings/categories.html', to: '/glossary/categories/', }, { from: '/User_Guide/managing_unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Marketing_Campaigns/api.html', to: '/API_Reference/Web_API_v3/Marketing_Campaigns/contactdb/', }, { from: '/User_Guide/Marketing_Campaigns/api_campaigns.html', to: '/API_Reference/Web_API_v3/Marketing_Campaigns/campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/faq.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Emails/create_manage.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Emails/dashboard.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Emails/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Emails/analytics.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/User_Guide/Marketing_Emails/recipients.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Marketing_Emails/sender_address.html', to: '/ui/sending-email/senders/', }, { from: '/User_Guide/Marketing_Emails/tags.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Emails/unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/multiple_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/User_Guide/peer_invitations.html', to: '/glossary/peer-invitations/', }, { from: '/User_Guide/reconfirmation.html', to: '/glossary/reconfirmation/', }, { from: '/User_Guide/sending_practices.html', to: '/glossary/rate-limiting/', }, { from: '/User_Guide/Settings/multiple_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/User_Guide/Setting_Up_Your_Server/clicktracking_ssl.html', to: '/ui/analytics-and-reporting/click-tracking-ssl/', }, { from: '/User_Guide/Setting_Up_Your_Server/content_delivery_networks.html', to: '/ui/sending-email/content-delivery-networks/', }, { from: '/User_Guide/Setting_Up_Your_Server/Segmenting_Your_Traffic/index.html', to: '/ui/managing-contacts/segmenting-your-contacts/', }, { from: '/User_Guide/Setting_Up_Your_Server/Segmenting_Your_Traffic/subusers.html', to: '/ui/account-and-settings/subusers/', }, { from: '/User_Guide/Setting_Up_Your_Server/smtp_ports.html', to: '/for-developers/sending-email/getting-started-smtp/', }, { from: '/User_Guide/Setting_Up_Your_Server/warming_up_ips.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/User_Guide/Setting_Up_Your_Server/warming_up.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/User_Guide/Setting_Up_Your_Server/Whitelabeling/dns_setup.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Setting_Up_Your_Server/Whitelabeling/index.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Setting_Up_Your_Server/Whitelabeling/spf.html', to: '/glossary/spf/', }, { from: '/User_Guide/Setting_Up_Your_Server/Whitelabeling/whitelabel_wizard.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/alert_settings.html', to: '/ui/account-and-settings/alerts/', }, { from: '/User_Guide/Settings/dkim.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/domain_keys.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/User_Guide/Settings/gravatar.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Settings/ips.html', to: '/ui/account-and-settings/dedicated-ip-addresses/', }, { from: '/User_Guide/smtp_ports.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/User_Guide/template_engine_setup.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/throttling.html', to: '/glossary/throttling/', }, { from: '/User_Guide/two_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/ ', }, { from: '/User_Guide/Transactional_Email/Template_Engine/setup_guide.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/warming_up.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/User_Guide/whitelabel_wizard.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/multifactor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/ ', }, { from: '/User_Guide/multifactor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/ ', }, { from: '/User_Guide/Marketing_Campaigns/Campaigns/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/Campaigns/a_b_testing.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/User_Guide/Settings/index.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Marketing_Campaigns/design_editor.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Campaigns/code_editor.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Campaigns/beta_editors.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/analytics.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/create_manage.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/dashboard.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/recipients.html', to: '/ui/sending-email/managing-contact-list/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/sender_address.html', to: '/ui/sending-email/senders/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/tags.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Legacy_Features/Marketing_Emails/unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/Utilities/event_kit.html', to: '/for-developers/tracking-events/event-kit/', }, { from: '/Utilities/deliverabilitycenter.html', to: '/ui/sending-email/deliverability/ ', }, { from: '/Utilities/index.html', to: '/', }, { from: '/Utilities/list_assist.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/Utilities/smtpapi_validator.html', to: '/for-developers/sending-email/sending-email-smtp/', }, { from: '/User_Guide/Templates/index.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Templates/create_edit.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Templates/manage.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/VidGrid/activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/VidGrid/advanced_suppression_manager.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/VidGrid/Email_Activity/activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/VidGrid/Event_Notification/configure.html', to: '/for-developers/tracking-events/event/', }, { from: '/VidGrid/Event_Notification/eventkit.html', to: '/for-developers/tracking-events/event-kit/', }, { from: '/VidGrid/Event_Notification/index.html', to: '/for-developers/tracking-events/event/', }, { from: '/VidGrid/index.html', to: '/', }, { from: '/VidGrid/Tools/listassist.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/VidGrid/Marketing_Emails/Analytics/index.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/VidGrid/Marketing_Emails/Analytics/marketing_statistics.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/VidGrid/Marketing_Emails/Analytics/unsubscribe_management.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/VidGrid/Marketing_Emails/Design/drag_and_drop.html', to: '/ui/sending-email/editor/', }, { from: '/VidGrid/Marketing_Emails/Design/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/VidGrid/Marketing_Emails/Design/newsletter_basics.html', to: '/ui/sending-email/editor/', }, { from: '/VidGrid/Marketing_Emails/Design/subscription_widget.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/VidGrid/Marketing_Emails/Design/weblink.html', to: '/ui/sending-email/editor/', }, { from: '/VidGrid/Marketing_Emails/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/VidGrid/Marketing_Emails/marketing_emails_setup.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/VidGrid/Marketing_Emails/Recipients/exporting.html', to: '//ui/managing-contacts/managing-contact-list/', }, { from: '/VidGrid/Marketing_Emails/Recipients/index.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/VidGrid/Marketing_Emails/Recipients/recipient_list.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/VidGrid/Marketing_Emails/Review_and_Schedule/scheduling.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/VidGrid/Marketing_Emails/Review_and_Schedule/split_testing.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/VidGrid/Marketing_Emails/Setup/overview.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/VidGrid/Subuser/create_subuser.html', to: '/ui/account-and-settings/subusers/', }, { from: '/VidGrid/Subuser/create_subuser_whitelabel.html', to: '/ui/account-and-settings/subusers/', }, { from: '/VidGrid/template_engine.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/VidGrid/Template_Engine/template_engine.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/VidGrid/Tools/index.html', to: ' ', }, { from: '/VidGrid/Whitelabel/whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication ', }, { from: '/VidGrid/whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication ', }, { from: '/VidGrid/Marketing_Emails/Review_and_Schedule/index.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/User_Guide/Marketing_Campaigns/campaigns.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/beta_editors.html#-Edit-HTML-Head', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/analytics.html', to: '/ui/sending-email/marketing-campaigns-stats/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/create_manage.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/dashboard.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/recipients.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/sender_address.html', to: '/ui/sending-email/senders/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/tags.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Features/unsubscribes.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/faq.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/migration_checklist.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/migrating_recipient_lists.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/migrating_unsubscribes.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/migrating_images.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/downloading_historical_statistics.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/api_migration.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/Migrating_API.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/campaign_building.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/contact_management.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/statistics_reporting.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/pricing.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/api_comparison.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Side_by_Side_Comparisons/security_compliance.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/Migration_Tutorials/migrating_content.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Legacy_Newsletter/Legacy_Newsletter_Migration/letter_from_our_CPO.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migrating_content.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migrating_images.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migrating_lists.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/Classroom/Basics/Marketing_Campaigns/migrating_unsubscribes.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/Classroom/Deliver/Address_Lists/list_scrubbing_guide.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/where_did_you_get_my_address_permission_reminders.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/let_old_addresses_sleep_in_peace.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Glossary/opt_in_email.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/preference_centers_giving_subscribers_control.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/affiliate_lists_and_list_sharing.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/peer_initiated_email_invitation_requirements.html', to: '/ui//managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/tips_to_keep_your_list_organized.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Deliver/Address_Lists/why_purchased_email_lists_are_no_good.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Basics/Account/resetting_your_password_without_breaking_current_integrations.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Basics/Security/security_checklist.html', to: '/ui/account-and-settings/hippa-compliant/', }, { from: '/Classroom/Basics/Security/secure_upload_download_supression_lists.html', to: '/', gone: true, }, { from: '/Classroom/Basics/Security/password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/Classroom/Basics/Security/keeping_your_registration_form_secure.html', to: '/', gone: true, }, { from: '/Classroom/Basics/Security/is_sendgrid_pci_compliant.html', to: '/ui/account-and-settings/pci-compliant/', }, { from: '/Classroom/Basics/Security/is_sendgrid_hipaa_compliant.html', to: '/ui/account-and-settings/hipaa-compliant/', }, { from: '/Classroom/Basics/Security/dont_share_your_password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/User_Guide/Marketing_Campaigns/marketing_campaigns_video_tutorials.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/overview.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Basics/Marketing_Campaigns/marketing_campaigns_video_tutorials.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/Classroom/Troubleshooting/dont_know_your_username.html', to: '/ui/account-and-settings/reset-username-password/', }, { from: '/Delivery_Metrics/metrics.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/User_Guide/Settings/Subusers/impersonation.html', to: '/ui/account-and-settings/subusers/', }, { from: '/User_Guide/Settings/Subusers/settings.html', to: '/ui/account-and-settings/subusers/', }, { from: '/User_Guide/Settings/Subusers/index.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/Account/what_are_subusers.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/Account/why_am_i_seeing_credential_resource_already_exists_when_i_am_creating_a_subuser_or_credential.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Send/How_Emails_Are_Sent/how_do_i_send_mail_through_subuser_accounts.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Deliver/Delivery_Introduction/segment_your_email_traffic_with_subusers.html', to: '/ui/account-and-settings/subusers/', }, { from: '/Classroom/Basics/Account/how_can_i_cancel_my_account.html', to: '/ui/account-and-settings/cancel-your-account/', }, { from: '/Classroom/Track/Bounces/common_smtp_server_bounce_responses.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Troubleshooting/Authentication/certificate_verification_failed.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/Classroom/Troubleshooting/Authentication/invalid_smtp_api_header.html', to: '/for-developers/sending-email/smtp-errors-and-troubleshooting/', }, { from: '/User_Guide/Marketing_Campaigns/drag_drop.html', to: '/ui/sending-email/editor/', }, { from: '/Classroom/Troubleshooting/Account_Administration/recovering_your_username.html', to: '/ui/account-and-settings/reset-username-password/', }, { from: '/Classroom/Deliver/Delivery_Introduction/ip_warmup_schedule.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Basics/Misc/automated_ip_warmup.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/Classroom/Basics/Billing/how_to_read_your_invoice.html', to: '/ui/account-and-settings/reading-your-invoice/', }, { from: '/Classroom/Basics/Billing/update_your_credit_card_and_resubmit_payments.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/lite_account_minimum_charge.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/legacy_lite_plan.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/is_your_account_billing_warned.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/is_your_account_billing_frozen.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/index.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/i_would_like_to_request_a_refund.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/how_does_overage_pricing_work.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/how_does_billing_work_for_marketing_campaigns.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/how_does_billing_work_for_legacy_newsletter.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/how_do_i_upgrade_or_downgrade_my_account.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/forgot_to_cancel_or_upgrade.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/did_you_receive_a_billing_notification.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/billing_info_and_faqs.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Account/why_are_the_pro_plans_recommended_above_all_others.html', to: '/pricing/', }, { from: '/Classroom/Basics/Account/sending_practices.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Basics/Billing/where_can_i_find_my_invoices.html', to: '/ui/account-and-settings/reading-your-invoice/', }, { from: '/Classroom/Basics/Billing/alternate_payment_methods.html', to: '/ui/account-and-settings/billing/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/max_hourly_limit.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/max_connection_limit.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Troubleshooting/Delivery_Issues/my_client_is_complaining_that_they_have_not_received_an_email.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Introduction/how_can_i_tell_if_an_email_was_actually_delivered.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Introduction/discrepancies_between_requests_and_deliveries.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Drops/resend_dropped_messages.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Drops/drop_reason_unsubscribed_address.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Drops/drop_reason_bounced_address.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Collecting_Data/can_i_download_a_list_of_click_and_or_open_events.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Bounces/implementing_bounce_notification_for_multiple_from_addresses.html', to: '/ui/sending-email/bounces/', }, { from: '/Classroom/Track/Bounces/how_to_set_up_bounce_forwarding_to_go_to_the_emails_from_address.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Bounces/how_to_set_up_bounce_forwarding.html', to: '/ui/sending-email/bounces/', }, { from: '/Classroom/Track/Bounces/delete_from_bounce_list_option_in_email_activity.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Bounces/bounce_reports_how_can_i_be_notified.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Track/Bounces/bounce_forwarding_and_gmail.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Deliver/Undeliverable_Email/why_did_my_message_show_as_delivered_first_then_as_bounced.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/search.html', to: '', }, { from: '/Classroom/Troubleshooting/Authentication/list_upload_troubleshooting.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/User_Guide/Marketing_Campaigns/contacts.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/Classroom/Basics/Marketing_Campaigns/how_to_remove_unusable_contacts.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Compliance/improving_contact_lists.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/Classroom/Send/Who_You_Can_Send_To/segmenting_traffic.html', to: '/ui/managing-contacts/segmenting-your-contacts/', }, { from: '/Classroom/Deliver/Delivery_Introduction/keep_in_touch_the_importance_of_engagement.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Send/Who_You_Can_Send_To/resubscription_of_users.html', to: '/ui/managing-contacts/segmenting-your-contacts/', }, { from: '/Classroom/Send/Who_You_Can_Send_To/can_i_send_to_purchased_lists.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/Classroom/Basics/Account/creating_teammates_for_subusers.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Account/what_is_the_difference_between_subusers_and_multiple_credentials.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Account/resetting_your_password_as_a_teammate.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Troubleshooting/Account_Administration/teammates.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Basics/Account/teammates_faq.html', to: '/ui/account-and-settings/teammates/', }, { from: '/Classroom/Troubleshooting/a_custom_field_value_did_not_substitute_during_a_send.html', to: '/ui/managing-contacts/custom-fields/', }, { from: '/Classroom/Basics/Marketing_Campaigns/contact_fields.html', to: '/ui/managing-contacts/custom-fields/', }, { from: '/Classroom/Troubleshooting/Authentication/you_have_used_a_reserved_field_name_for_your_custom_field.html#', to: '/ui/managing-contacts/custom-fields/', }, { from: '/Classroom/Basics/Marketing_Campaigns/contact_fields.html#', to: '/ui/managing-contacts/custom-fields/', }, { from: '/User_Guide/Marketing_Campaigns/format_CSV.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/User_Guide/email_activity_beta.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/Classroom/Basics/API/why_event_api.html', to: '/for-developers/tracking-events/event-webhook/', }, { from: '/Release_Notes/release_notes.html', to: '/release-notes/', }, { from: '/User_Guide/Transactional_Templates/manage.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Transactional_Templates/index.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Transactional_Templates/how_to_send_an_email_with_dynamic_transactional_templates.html', to: '/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', }, { from: '/User_Guide/Transactional_Templates/using_handlebars.html', to: '/ui/sending-email/using-handlebars/', }, { from: '/User_Guide/Transactional_Templates/Using_handlebars.html', to: '/ui/sending-email/using-handlebars/', }, { from: '/User_Guide/Settings/Whitelabel/ips.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/User_Guide/Settings/Whitelabel/links.html', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/User_Guide/Settings/Whitelabel/domains.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Whitelabel/overview.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Sender_Authentication/how-to-set-up-domain-authentication.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Whitelabel/index.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Sender_authentication/How_to_set_up_domain_authentication.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/Authentication/whitelabel_video_tutorials.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/Authentication/upgrading_your_whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Troubleshooting/Authentication/i_have_created_dns_records_but_the_whitelabel_wizard_is_not_validating_them.html', to: '/ui/sending-email/troubleshooting/', }, { from: '/Classroom/Troubleshooting/Authentication/dns_records_and_underscores.html', to: '/ui/sending-email/troubleshooting/', }, { from: '/Classroom/Deliver/Sender_Authentication/what_is_automated_security_in_the_whitelabel_settings.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Deliver/Delivery_Introduction/creating_and_whitelabeling_a_subuser_to_a_new_sending_domain.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Deliver/Delivery_Introduction/all_you_need_to_know_about_whitelabeling.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Basics/Whitelabel/whitelabel_vs_whitelist.html', to: '/glossary/whitelabel/', }, { from: '/Classroom/Basics/Whitelabel/subuser_whitelabels.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Basics/Whitelabel/setup_domain_whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/Classroom/Basics/Whitelabel/link_whitelabels_explained.html', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/Classroom/Basics/Whitelabel/index.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Whitelabel/providers.html', to: '/ui/account-and-settings/dns-providers/', }, { from: '/User_Guide/Settings/Whitelabel/faq.html', to: '/glossary/whitelabel/', }, { from: '/User_Guide/Settings/Sender_Authentication/How_to_set_up_reverse_DNS.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/User_Guide/Settings/Sender_Authentication/how-to-set-up-link-branding.html', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/Classroom/Basics/Whitelabel/setup_ip_whitelabel.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/User_Guide/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/email_activity.html', to: '/ui/analytics-and-reporting/email-activity/', }, { from: '/User_Guide/email_activity_feed.html', to: '/ui/analytics-and-reporting/email-activity-feed/', }, { from: '/User_Guide/SendGrid_for_Mobile/dashboard.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/SendGrid_for_Mobile/email_activity.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/SendGrid_for_Mobile/suppression.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/SendGrid_for_Mobile/subusers.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/SendGrid_for_Mobile/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Legacy_Newsletter/index.html', to: '/ui/sending-email/legacy-newsletter-sunset/', }, { from: '/User_Guide/Marketing_Campaigns/index.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/getting_started.html', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/User_Guide/Marketing_Campaigns/notifications.html', to: '/ui/account-and-settings/notifications/', }, { from: '/User_Guide/Marketing_Campaigns/editor.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Campaigns/senders.html', to: '/ui/sending-email/senders/', }, { from: '/User_Guide/Marketing_Campaigns/custom_fields.html', to: '/ui/managing-contacts/custom-fields/', }, { from: '/User_Guide/Marketing_Campaigns/a_b_testing.html', to: '/ui/sending-email/a-b-testing/', }, { from: '/User_Guide/Marketing_Campaigns/campaign_stats.html', to: '/ui/analytics-and-reporting/marketing-campaigns-stats/', }, { from: '/User_Guide/Marketing_Campaigns/Old_Editor_Sunset.html', to: '/ui/sending-email/editor/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/building_your_contact_list.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/adding_contacts.html', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/formatting_a_CSV.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/managing_contact_list.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/segmenting_your_contacts.html', to: '/ui/managing-contacts/segmenting-your-contacts/', }, { from: '/User_Guide/Statistics/index.html', to: '/ui/analytics-and-reporting/stats-overview/', }, { from: '/User_Guide/Statistics/browser.html', to: '/ui/analytics-and-reporting/browser/', }, { from: '/User_Guide/Statistics/categories.html', to: '/ui/analytics-and-reporting/categories/', }, { from: '/User_Guide/Statistics/device.html', to: '/ui/analytics-and-reporting/device/', }, { from: '/User_Guide/Statistics/geo.html', to: '/ui/analytics-and-reporting/geographic/', }, { from: '/User_Guide/Statistics/global.html', to: '/ui/analytics-and-reporting/global/', }, { from: '/User_Guide/Statistics/mailbox_provider.html', to: '/ui/analytics-and-reporting/mailbox-provider/', }, { from: '/User_Guide/Statistics/mailbox_provider_compare.html', to: '/ui/analytics-and-reporting/mailbox-provider-comparison/', }, { from: '/User_Guide/Statistics/parse.html', to: '//for-developers/parsing-email/inbound-email/', }, { from: '/User_Guide/Statistics/subuser.html', to: '/ui/analytics-and-reporting/subuser/', }, { from: '/User_Guide/Statistics/subuser_compare.html', to: '/ui/analytics-and-reporting/subuser-comparison/', }, { from: '/User_Guide/Suppressions/index.html', to: '/ui/sending-email/index-suppressions/', }, { from: '/User_Guide/Suppressions/advanced_suppression_manager.html', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/User_Guide/Suppressions/blocks.html', to: '/ui/sending-email/blocks/', }, { from: '/User_Guide/Suppressions/bounces.html', to: '/ui/sending-email/bounces/', }, { from: '/User_Guide/Suppressions/global_unsubscribes.html', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/User_Guide/Suppressions/group_unsubscribes.html', to: '/ui/sending-email/group-unsubscribes/', }, { from: '/User_Guide/Suppressions/invalid_emails.html', to: '/ui/sending-email/invalid-emails/', }, { from: '/User_Guide/Suppressions/recipient_subscription_preferences.html', to: '/ui/sending-email/recipient-subscription-preferences/ ', }, { from: '/User_Guide/Suppressions/spam_reports.html', to: '/ui/analytics-and-reporting/spam-reports/', }, { from: '/User_Guide/Transactional_Templates/create_and_edit_transactional_templates.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/Settings/account.html', to: '/ui/account-and-settings/account/', }, { from: '/User_Guide/Settings/alerts.html', to: '/ui/account-and-settings/alerts/', }, { from: '/User_Guide/Settings/api_keys.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/User_Guide/Settings/billing.html', to: '/ui/account-and-settings/billing/', }, { from: '/User_Guide/Settings/cancel_account.html', to: '/ui/account-and-settings/cancel-your-account/', }, { from: '/User_Guide/Settings/dedicated_ip_addresses.html', to: '/ui/account-and-settings/dedicated-ip-addresses/', }, { from: '/User_Guide/Settings/ip_access_management.html', to: '/ui/account-and-settings/ip-access-management/', }, { from: '/User_Guide/Settings/ip_warmup.html', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/User_Guide/Settings/mail.html', to: '/ui/account-and-settings/mail/', }, { from: '/User_Guide/Settings/parse.html', to: '/ui/account-and-settings/inbound-parse/', }, { from: '/User_Guide/Settings/partners.html', to: '/ui/account-and-settings/partners/', }, { from: '/User_Guide/Settings/reading_your_invoice.html', to: '/ui/account-and-settings/reading-your-invoice/', }, { from: '/User_Guide/Settings/reset_username_password.html', to: '/ui/account-and-settings/resetting-your-username-and-password/', }, { from: '/User_Guide/Settings/subusers.html', to: '/ui/account-and-settings/subusers/', }, { from: '/User_Guide/Settings/teammates.html', to: '/ui/account-and-settings/teammates/', }, { from: '/User_Guide/Settings/tracking.html', to: '/ui/account-and-settings/tracking/', }, { from: '/User_Guide/Settings/two_factor_authentication.html', to: '/ui/account-and-settings/two-factor-authentication/ ', }, { from: '/User_Guide/Settings/Sender_authentication/how-to-set-up-domain-authentication.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Sender_authentication/how-to-set-up-link-branding.html', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/User_Guide/Settings/Sender_authentication/how-to-set-up-reverse-dns.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/User_Guide/Settings/Sender_authentication/Troubleshooting.html', to: '/ui/account-and-settings/troubleshooting-sender-authentication/', }, { from: '/User_Guide/Settings/Sender_authentication/providers.html', to: '/ui/account-and-settings/dns-providers/', }, { from: '/Glossary/index.html', to: '/glossary/', }, { from: '/Glossary/7_bit_encoding.html', to: '/glossary/7-bit-encoding/', }, { from: '/Glossary/a_record.html', to: '/glossary/a-record/', }, { from: '/Glossary/automated_email.html', to: '/glossary/automated-email/', }, { from: '/Glossary/autoresponder.html', to: '/glossary/autoresponder/', }, { from: '/Glossary/bayesian_filter.html', to: '/glossary/bayesian-filter/', }, { from: '/Glossary/black_hat_sender.html', to: '/glossary/black-hat-sender/', }, { from: '/Glossary/blacklists.html', to: '/glossary/blacklists/', }, { from: '/Glossary/blocks.html', to: '/glossary/blocks/', }, { from: '/Glossary/bounces.html', to: '/glossary/bounces/', }, { from: '/Glossary/bulk_email_service.html', to: '/glossary/bulk-email-service/', }, { from: '/Glossary/bulk_mail_folder.html', to: '/glossary/bulk-mail-folder/', }, { from: '/Glossary/campaigns.html', to: '/glossary/campaigns/', }, { from: '/Glossary/can_spam.html', to: '/glossary/can-spam/', }, { from: '/Glossary/categories.html', to: '/glossary/categories/', }, { from: '/Glossary/challenge_response.html', to: '/glossary/challenge-response/', }, { from: '/Glossary/clicks.html', to: '/glossary/clicks/', }, { from: '/Glossary/cname.html', to: '/glossary/cname/', }, { from: '/Glossary/complaint.html', to: '/glossary/complaint/', }, { from: '/Glossary/ctr.html', to: '/glossary/ctr/', }, { from: '/Glossary/custom_fields.html', to: '/glossary/custom-fields/', }, { from: '/Glossary/deferrals.html', to: '/glossary/deferrals/', }, { from: '/Glossary/deliveries.html', to: '/glossary/deliveries/', }, { from: '/Glossary/dkim.html', to: '/glossary/dkim/', }, { from: '/Glossary/dmarc.html', to: '/glossary/dmarc/', }, { from: '/Glossary/dns.html', to: '/glossary/dns/', }, { from: '/Glossary/domain.html', to: '/glossary/domain/', }, { from: '/Glossary/domain_authentication.html', to: '/glossary/domain-authentication/', }, { from: '/Glossary/drip_campaign.html', to: '/glossary/drip-campaign/', }, { from: '/glossary/drops/.html', to: '/glossary/drops/ ', }, { from: '/Glossary/email_api_integration.html', to: '/glossary/email-api-integration/', }, { from: '/Glossary/email_authentication.html', to: '/glossary/email-authentication/', }, { from: '/Glossary/email_deliverability.html', to: '/glossary/deliverability/', }, { from: '/Glossary/email_harvesting.html', to: '/glossary/email-harvesting/', }, { from: '/Glossary/email_marketing.html', to: '/glossary/email-marketing/', }, { from: '/Glossary/email_service_provider.html', to: '/glossary/email-service-provider ', }, { from: '/Glossary/event_webhook.html', to: '/glossary/event-webhook/', }, { from: '/Glossary/expired.html', to: '/glossary/expired/', }, { from: '/Glossary/feedback_loop.html', to: '/glossary/feedback-loop/', }, { from: '/Glossary/header.html', to: '/glossary/header/', }, { from: '/Glossary/imap.html', to: '/glossary/imap/', }, { from: '/Glossary/invalid_email.html', to: '/glossary/invalid-email/', }, { from: '/Glossary/ip_address.html', to: '/glossary/ip-address/', }, { from: '/Glossary/ip_warmup.html', to: '/glossary/ip-warmup/', }, { from: '/Glossary/link_branding.html', to: '/glossary/link-branding/', }, { from: '/Glossary/lists.html', to: '/glossary/lists/', }, { from: '/Glossary/mail_merge.html', to: '/glossary/mail-merge/', }, { from: '/Glossary/mailbox_provider.html', to: '/glossary/mailbox-provider/', }, { from: '/Glossary/message_id.html', to: '/glossary/message-id/', }, { from: '/Glossary/mta.html', to: '/glossary/mta/', }, { from: '/Glossary/mx_record.html', to: '/glossary/mx-record/', }, { from: '/Glossary/open_rate.html', to: '/glossary/open-rate/', }, { from: '/Glossary/openrelay.html', to: '/glossary/openrelay/', }, { from: '/Glossary/peer_invitations.html', to: '/glossary/peer-invitations/', }, { from: '/Glossary/preheader.html', to: '/glossary/preheader/', }, { from: '/Glossary/rate_limiting.html', to: '/glossary/rate-limiting/', }, { from: '/Glossary/reconfirmation.html', to: '/glossary/reconfirmation/', }, { from: '/Glossary/reputation_monitoring.html', to: '/glossary/reputation-monitoring/', }, { from: '/Glossary/request.html', to: '/glossary/request/', }, { from: '/Glossary/reseller_email_account.html', to: '/glossary/reseller-email-account/', }, { from: '/Glossary/reserved_fields.html', to: '/glossary/reserved-fields/', }, { from: '/Glossary/reverse_dns.html', to: '/glossary/reverse-dns/', }, { from: '/Glossary/scheduled_emails.html', to: '/glossary/scheduled-emails/', }, { from: '/Glossary/segments.html', to: '/glossary/segments/', }, { from: '/Glossary/segmentation.html', to: '/glossary/segmentation/', }, { from: '/Glossary/senders.html', to: '/glossary/senders/', }, { from: '/Glossary/sender_authentication.html', to: '/glossary/sender-authentication/', }, { from: '/Glossary/smtp.html', to: '/glossary/smtp/', }, { from: '/Glossary/smtp_api.html', to: '/glossary/smtp-api/', }, { from: '/Glossary/smtp_provider.html', to: '/glossary/smtp-provider/', }, { from: '/Glossary/smtp_relay.html', to: '/glossary/smtp-relay/', }, { from: '/Glossary/smtp_server.html', to: '/glossary/smtp-server/', }, { from: '/Glossary/smtp_service.html', to: '/glossary/smtp-service/', }, { from: '/Glossary/spam.html', to: '/glossary/spam/', }, { from: '/Glossary/spam_filter.html', to: '/glossary/spam-filter/', }, { from: '/Glossary/spam_reports.html', to: '/glossary/spam-reports/', }, { from: '/Glossary/spam_traps.html', to: '/glossary/spam-traps/', }, { from: '/Glossary/spf.html', to: '/glossary/spf/', }, { from: '/Glossary/spoofing.html', to: '/glossary/spoofing/', }, { from: '/Glossary/subjects.html', to: '/glossary/subjects/', }, { from: '/Glossary/subscriber_list_management.html', to: '/glossary/subscriber-list-management/', }, { from: '/Glossary/system_fields.html', to: '/glossary/system-fields/', }, { from: '/Glossary/teammates.html', to: '/glossary/teammates/', }, { from: '/Glossary/throttling.html', to: '/glossary/throttling/', }, { from: '/Glossary/timezone.html', to: '/glossary/timezone/', }, { from: '/Glossary/tls.html', to: '/glossary/tls/', }, { from: '/Glossary/transactional_email.html', to: '/glossary/transactional-email/', }, { from: '/Glossary/transactional_email_templates.html', to: '/glossary/transactional-email-templates/', }, { from: '/Glossary/triggered_actions.html', to: '/glossary/triggered-actions/', }, { from: '/Glossary/triggered_email.html', to: '/glossary/triggered-email/', }, { from: '/Glossary/two_factor_authentication.html', to: '/glossary/two-factor-authentication/', }, { from: '/Glossary/undelivered_email.html', to: '/glossary/undelivered-email/', }, { from: '/Glossary/unknown_user.html', to: '/glossary/unknown-user/', }, { from: '/Glossary/web_api.html', to: '/glossary/web-api/', }, { from: '/Glossary/white_hat_sender.html', to: '/glossary/white-hat-sender/', }, { from: '/Glossary/whitelabel.html', to: '/glossary/whitelabel/', }, { from: '/Glossary/whitelist.html', to: '/glossary/whitelist/', }, { from: '/Glossary/x_message_id.html', to: '/glossary/x-message-id/', }, { from: '/Classroom/Deliver/Undeliverable_Email/my_emails_are_going_to_spam.html', to: '/ui/sending-email/deliverability/', }, { from: '/User_Guide/Settings/Sender_Authentication/How_to_set_up_domain_authentication.html', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/User_Guide/Settings/Sender_Authentication/How_to_set_up_link_branding.html', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts_lists.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/format_CSV.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/User_Guide/Transactional_Templates/create__and_edit_transactional_templates.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/User_Guide/MarketingUser_Guide/Marketing_Campaigns/Managing_Contacts/managing_contact_list.html', to: '/ui/managing-contacts/building-your-contact-list/', }, { from: '/User_Guide/Account_Management/cancel_account.html', to: '/ui/account-and-settings/cancel-your-account/', }, { from: '/User_Guide/Marketing_Campaigns/formatting_a_CSV.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/User_Guide/Legacy_Newsletter/recipients.html', to: '/ui/managing-contacts/managing-contact-list/', }, { from: '/User_Guide/Transactional_Templates/Create_and_edit_dynamic_transactional_templates.html', to: '/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', }, { from: '/Classroom/Deliver/Undeliverable_Email/help_my_emails_arent_being_delivered.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Send/v3_Mail_Send/curl_examples.html', to: '/for-developers/sending-email/curl-examples/', }, { from: '/Classroom/Deliver/Undeliverable_Email/why_is_sendgrid_net_greylisted.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Undeliverable_Email/my_emails_are_being_dropped.html', to: '/glossary/drops/', }, { from: '/Classroom/Deliver/Undeliverable_Email/what_do_i_do_if_im_blacklisted.html', to: '/ui/sending-email/deliverability/', }, { from: '/Glossary/drops.html', to: '/glossary/drops/', }, { from: '/Classroom/Basics/API/api_key_permissions.html', to: '/ui/account-and-settings/api-keys/', }, { from: '/Classroom/Basics/Email_Infrastructure/ssl_vs_tls.html', to: '/ui/sending-email/deliverability/', }, { from: '/User_Guide/Statistics/category_compare.html', to: '/ui/analytics-and-reporting/category-comparison/', }, { from: '/Integrate/Tutorials/piesync.html', to: '/for-developers/sending-email/piesync/', }, { from: '/Classroom/Deliver/Undeliverable_Email/how_do_i_keep_emails_from_dropping.html', to: '/ui/sending-email/deliverability/', }, { from: '/User_Guide/Settings/Sender_authentication/How_to_set_up_reverse_dns.html', to: '/ui/account-and-settings/how-to-set-up-reverse-dns/', }, { from: '/Classroom/Basics/Misc/your_reputation_what_is_it.html', to: '/ui/sending-email/deliverability/', }, { from: '/User_Guide/Settings/taxes_and_tax_exempt.html', to: '/ui/account-and-settings/taxes-and-tax-exempt/', }, { from: '/release_notes.html', to: '/release-notes/', }, { from: '/Classroom/Deliver/Undeliverable_Email/google_feedback_loop_spam_complaints.html', to: '/ui/sending-email/deliverability/', }, { from: '/Classroom/Deliver/Undeliverable_Email/spam_trapped.html', to: '/ui/sending-email/deliverability/', }, { from: '/Integrate/Tutorials/Zapier/index.html', to: '/for-developers/sending-email/zapier-sending-for-new-webhook-data/', }, { from: '/Classroom/Send/v3_Mail_Send/index.html', to: '/api-reference/', }, { from: '/User_Guide/Settings/Sender_authentication/How_to_set_up_link_branding.html', to: '/glossary/link-branding/', }, { from: '/User_Guide/Transactional_Templates/migrating_from_legacy_templates.html', to: '/ui/sending-email/migrating-from-legacy-templates/', }, { from: '/User_Guide/Marketing_Campaigns/templates.html', to: '/ui/sending-email/create-and-edit-transactional-templates/', }, { from: '/Integrate/Tutorials/EngineYard.html', to: '/for-developers/partners/google/', }, { from: '/User_Guide/Marketing_Campaigns/Managing_Contacts/formating_a_CSV.html', to: '/ui/managing-contacts/formatting-a-csv/', }, { from: '/Integrate/Open_Source_Apps/modx.html', to: '/for-developers/sending-email/modx/', }, { from: '/ui/sending-email/reputation/', to: '/ui/sending-email/deliverability/', }, { from: '/ui/sending-email/create-and-edit-transactional-templates/', to: '/ui/sending-email/create-and-edit-legacy-transactional-templates/', }, { from: '/ui/managing-contacts/adding-contacts/', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/ui/sending-email/working-with-marketing-templates/', to: '/ui/sending-email/working-with-marketing-campaigns-email-designs/', }, { from: '/ui/managing-contacts/managing-contact-list/', to: '/ui/managing-contacts/create-and-manage-contacts/', }, { from: '/ui/ads/', to: '/', }, { from: '/User_Guide/Marketing_Campaigns/create-and-manage-unsubscribe-groups.html', to: '/ui/sending-email/create-and-manage-unsubscribe-groups/', }, { from: '/User_Guide/Statistics/browser_compare.html', to: '/ui/analytics-and-reporting/browser-comparison/', }, { from: '/ui/analytics-and-reporting/mailbox-provider/', to: '/ui/analytics-and-reporting/mailbox-provider-comparison/', }, { from: '/ui/sending-email/using-handlebars/', to: '/for-developers/sending-email/using-handlebars/', }, { from: '/for-developers/sending-email/building-an-smtp-email/', to: '/for-developers/sending-email/building-an-x-smtpapi-header/', }, { from: '/for-developers/sending-email/sandbox/', to: '/for-developers/sending-email/sandbox-mode/', }, { from: '/for-developers/sending-email/sending-email-api/', to: '/for-developers/sending-email/api-getting-started/', }, { from: '/ui/account-and-settings/sending-email/global-unsubscribes/', to: '/ui/sending-email/global-unsubscribes/', }, { from: '/ui/account-and-settings/sending-email/how-to-send-email-with-marketing-campaigns/', to: '/ui/sending-email/how-to-send-email-with-marketing-campaigns/', }, { from: '/report-spam/', to: '/ui/account-and-settings/support/', }, { from: '/ui/account-and-settings/hippa-compliant/', to: '/ui/account-and-settings/hipaa-compliant/', }, { from: '/ui/sending-email/custom-ssl-configurations/', to: '/ui/account-and-settings/custom-ssl-configurations/', }, { from: '/Classroom/Build/Choose_Content/gmail_promotions_tab.html', to: 'https://sendgrid.com/blog/i-fought-the-tabs-and-the-tabs-won/', }, { from: '/resource/general-data-protection-regulation/', to: '/glossary/gdpr/', }, { from: '/ui/sending-email/sendmail/', to: '/for-developers/sending-email/sendmail/', }, { from: '/for-developers/sending-email/sending-email-smtp/', to: '/for-developers/sending-email/getting-started-smtp/', }, { from: '/ui/sending-email/can-i-send-adult-content-in-my-emails/', to: '/ui/sending-email/deliverability/#sending-adult-content', }, { from: '/ui/analytics-and-reporting/click-tracking/', to: '/ui/analytics-and-reporting/click-tracking-html-best-practices/', }, { from: '/ui/sending-email/unsubcribe-groups/', to: '/ui/sending-email/unsubscribe-groups/', }, { from: '/ui/analytics-and-reporting/subscription-tracking/', to: '/ui/sending-email/subscription-tracking/', }, { from: '/ui/account-and-settings/accessing-email-associated-with-sendgrid/', to: '/ui/account-and-settings/accessing-email-account-associated-with-sendgrid/', }, { from: '/ui/account-and-settings/checking-email-source/', to: '/ui/sending-email/checking-email-source/', }, { from: '/ui/sending-email/how-to-set-up-domain-authentication/', to: '/ui/account-and-settings/how-to-set-up-domain-authentication/', }, { from: '/ui/sending-email/how-to-set-up-link-branding/', to: '/ui/account-and-settings/how-to-set-up-link-branding/', }, { from: '/ui/account-and-settings/senders/', to: '/ui/sending-email/senders/', }, { from: '/ui/sending-email/how-to-warm-up-an-ip/', to: '/ui/sending-email/warming-up-an-ip-address/', }, { from: '/User_Guide/Settings/', to: '/', }, { from: '/index.html/', to: '/', }, { from: '/ui/sending-email/how-to-send-email-with-marketing-campaigns-with-dynamic-transactional-templates/', to: '/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', }, { from: '/for-developers/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', to: '/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/', }, { from: '/for-developers/sending-email/using-the-v2-api/', to: 'https://www.twilio.com/docs/sendgrid/api/v2/using_the_web_api', }, { from: '/glossary/blacklists/', to: 'glossary/deny-list/', }, { from: 'glossary/whitelist/', to: 'glossary/allow-list/', }, { from: '/ui/sending-email/blacklists/', to: '/ui/sending-email/deny-lists/', }, { from: '/glossary/white-hat-sender/', to: '/glossary/trusted-sender/', }, { from: 'glossary/black-hat-sender/', to: '/glossary/suspicious-sender/', }, { from: '/ui/account-and-settings/aol-dmarc/', to: '/ui/sending-email/dmarc/', }, { from: '/ui/account-and-settings/gmail-dmarc/', to: '/ui/sending-email/dmarc/', }, { from: '/ui/account-and-settings/microsoft-dmarc/', to: '/ui/sending-email/dmarc/', }, { from: '/ui/account-and-settings/yahoo-dmarc/', to: '/ui/sending-email/dmarc/', }, { from: '/for-developers/sending-email/v3-nodejs-code-example/', to: '/for-developers/sending-email/quickstart-nodejs/', }, { from: '/for-developers/partners/magento/', to: '/for-developers/partners/', }, { from: '/API_Reference/index.html', to: '/api-reference/', }, { from: '/API_Reference/api_getting_started.html', to: '/api-reference/', }, { from: '/API_Reference/index/', to: '/api-reference/', }, { from: '/API_Reference/SMTP_API/integrating_with_the_smtp_api.html', to: '/for-developers/sending-email/integrating-with-the-smtp-api/', }, { from: '/API_Reference/SMTP_API.*', to: '/for-developers/sending-email/getting-started-smtp/', }, { from: '/API_Reference/Web_API/.*', to: 'https://www.twilio.com/docs/sendgrid/api/v2', }, { from: '/API_Reference/Web_API_v3.*', to: '/api-reference/', }, { from: '/ui/account-and-settings/troubleshooting-login/', to: '/ui/account-and-settings/log-in-issues/', }, ]; ================================================ FILE: src/components/About/About.scss ================================================ .about { display: flex; justify-content: center; align-content: center; align-items: center; min-height: 300px; color: #f00; } ================================================ FILE: src/components/About/index.jsx ================================================ import React from 'react'; import './About.scss'; function About() { return ( <div className="about"> <h1> Edit About component or pages/about.jsx to include your information. </h1> </div> ); } export default About; ================================================ FILE: src/components/AsideMenu/index.jsx ================================================ import React, { Component } from 'react'; import _ from 'lodash'; class AsideMenu extends Component { constructor(props) { super(props); this.scrollSpy = this.scrollSpy.bind(this); // Scrollspy will highlight next section when header is 100 pixels from top of browser chrome. this.scrollSpyOffset = 100; this.state = { activeNavItem: false, pageType: this.props.pageType || false, }; } componentDidMount() { this.scrollSpy(); window.addEventListener('scroll', this.scrollSpy); } componentWillUnmount() { window.removeEventListener('scroll', this.scrollSpy); } scrollSpy() { const selector = this.state.pageType === 'release-notes' ? 'h2 .anchor' : 'h2 .anchor, h3 .anchor'; const headers = Array.from(document.querySelectorAll(selector)); // headers with offset const headersOffset = headers.map((el, i) => { const { slug } = el.dataset; let nextEl; // Offset for a given section is the NEXT header. if ((headers.length - 1) !== i) { nextEl = headers[i + 1].getBoundingClientRect().top; } else { nextEl = headers[i].getBoundingClientRect().top + 9000; } const offset = (nextEl + document.body.scrollTop) - this.scrollSpyOffset; return { slug, offset }; }); // Headers with postive scrolltop value const headersScrollTop = headersOffset.filter(el => el.offset > 0); this.setState({ activeNavItem: headersScrollTop[0] }); } render() { const navItems = this.props.asideLinks; return ( <aside className="aside-nav"> <div className="aside-nav__title is-size-h5">In the article</div> {navItems.map(el => { const { id, textNode, } = el; let classes = `doc-header ${el.tagName}`; if (el.id === this.state.activeNavItem.slug) { classes += ' active'; } return <a key={id} className={classes} href={`#${id}`}>{textNode}</a>; })} </aside> ); } } export default AsideMenu; ================================================ FILE: src/components/BreadCrumbs/index.jsx ================================================ import React, { Component } from 'react'; import { Link } from 'gatsby'; import _ from 'lodash'; class BreadCrumbs extends Component { constructor(props) { super(props); this.pathParts = this.getPathParts(); this.state = { items: this.getSubPaths(), }; } getPathParts() { const { location } = this.props; const { pathname } = location; const parts = pathname.split('/'); // We don't want "docs" or "UI" in the breadcrumbs return parts.filter(item => item.length && item !== 'docs'); } getSubPaths() { const { location } = this.props; const { pathname } = location; // No matter what, add and object that represents the docs home const home = [ { textNode: 'home', to: '/', }, ]; const allPaths = this.pathParts.map((text) => { const path = pathname.substring(0, pathname.indexOf(text)) + text; const to = `${path.replace('/docs', '')}/`; const textNode = text === 'ui' ? 'User Interface' : text.replace(/-/g, ' '); return ( { textNode, to, } ); }); this.allPaths = allPaths; // All paths but current page -- title is added in render method const subPaths = [...allPaths.slice(0, allPaths.length - 1)]; // Combine with home object and return. return [...home, ...subPaths]; } getTitle() { let pageTitle; const { data } = this.props; if (data && _.has(data[Object.keys(data)], 'fields')) { pageTitle = data[Object.keys(data)].fields.title; } else { pageTitle = this.pathParts.slice(-1)[0].replace(/-/g, ' '); } // update the last textNode with page title this.allPaths[this.allPaths.length - 1].textNode = pageTitle; return pageTitle; } getJSONLD() { const json = { '@context': 'http://schema.org', '@type': 'BreadcrumbList', itemListElement: [], }; const itemList = this.allPaths.map((item, index) => { const listItem = { '@type': 'ListItem', position: index + 1, item: { '@id': item.to, name: item.textNode, }, }; return listItem; }); json.itemListElement = [...itemList]; return json; } render() { const { items } = this.state; return ( <div> <ul className="breadcrumb"> {items.map((item) => { const classes = `breadcrumb-item-${item.textNode.replace(' ', '-').toLowerCase()}`; return ( <li key={item.textNode} className={classes}> <Link to={item.to}>{item.textNode}</Link> </li> ); })} <li dangerouslySetInnerHTML={{ __html: this.getTitle() }} /> </ul> <script type="application/ld+json"> {JSON.stringify(this.getJSONLD())} </script> </div> ); } } export default BreadCrumbs; ================================================ FILE: src/components/Footer/Footer.scss ================================================ @import '../../scss/global/variables'; .footer { background: $light-blue; font-size: $scaledown-1; padding: $scaleup-4 0; a { color: $slate-80; &:hover { color: $primary; } } ul { display: flex; justify-content: center; @media (max-width: $width-mobile) { flex-wrap: wrap; } } li { @media (max-width: $width-mobile) { margin: 0 $scale-base-up-04 $scale-base-down-02; } &::after { content: ' | '; display: inline-block; margin: 0 $scale-base-up-05; @media (max-width: $width-mobile) { display: none; } } } li:last-of-type { &::after { display: none; } } } .footer-logo { display: block; margin: 0 auto 20px; height: 28px; width: 28px; background: url('https://sendgrid.com/brand/sg-mark.svg') no-repeat center center; background-size: 34px; } ================================================ FILE: src/components/Footer/index.jsx ================================================ import React, { Component } from 'react'; import './Footer.scss'; class Footer extends Component { render() { return ( <footer className="footer"> <div className="container-lg footer-container"> <div className="footer-logo" /> <ul> <li> <a href="https://sendgrid.com/about/" title="About">About</a> </li> <li> <a href="https://sendgrid.com/policies/tos/" title="Terms">Terms</a> </li> <li> Copyright {(new Date().getFullYear())} Twilio SendGrid </li> <li> All Rights Reserved </li> <li> <a href="https://sendgrid.com/" title="SendGrid.com">SendGrid.com</a> </li> </ul> </div> </footer> ); } } export default Footer; ================================================ FILE: src/components/FooterCallout/FooterCallout.scss ================================================ @import '../../scss/global/variables'; .footer-callout { background: $slate; background: $gradient-callout; position: relative; padding: $scaleup-8 0; &-pattern { position: absolute; right: 0; bottom: 0; background: url('https://sendgrid.com/wp-content/themes/sgdotcom/assets/images/patterns/pixel-pattern-bottom-left-dark.svg') no-repeat bottom left; width: 100%; height: 100%; } .container { position: relative; } } ================================================ FILE: src/components/FooterCallout/index.jsx ================================================ import React from 'react'; import { Link } from 'gatsby'; import './FooterCallout.scss'; function FooterCallout() { return ( <div className="footer-callout"> <div className="footer-callout-pattern" /> <div className="container"> <div className="row"> <div className="col-md-6"> <h2 className="is-size-h1 color-white">For Developers</h2> <p className="color-slate-10">Integrate with SendGrid using our API or SMTP.</p> <Link className="btn btn-white" to="/for-developers/">View Developer Docs</Link> </div> <div className="col-md-6"> <div className="card card--glossary"> <h3 className="card__title">Quicklinks</h3> <p className="glossary-link"><Link to="/for-developers/sending-email/api-getting-started/">Getting Started</Link></p> <p className="glossary-link"><Link to="/api-reference/">API Documentation</Link></p> <p className="glossary-link"><Link to="/for-developers/sending-email/libraries/">Code Libraries</Link></p> <p className="glossary-link"><Link to="/ui/account-and-settings/api-keys/">API Keys</Link></p> </div> </div> </div> </div> </div> ); } export default FooterCallout; ================================================ FILE: src/components/GlossaryPartial/GlossaryPartial.scss ================================================ @import '../../scss/global/variables'; .home-glossary { margin: $scaleup-5 0; z-index: 2; h2 { position: relative; text-align: center; } } .home-glossary__container { padding-left: $scaleup-11; padding-right: $scaleup-11; @media (max-width: $width-mobile) { padding-left: 20px; padding-right: 20px; } } p.glossary-link { margin-bottom: $scaledown-1; } .glossary-icon { margin: 0 auto 0 $scaleup-1; display: block; @media (max-width: $width-mobile) { margin: $scaleup-1 auto 0; } } .for-devs-glossary { background: $mantis; background: $gradient-dev-glossary; padding: $scaleup-2 0; p, h2 { color: #fff; font-weight: 600; } p.glossary-link { font-weight: 400; } } ================================================ FILE: src/components/GlossaryPartial/glossaryPartial.jsx ================================================ import React, { Component } from 'react'; import { Link } from 'gatsby'; import LINKS from '../../constants/pageLinks'; import './GlossaryPartial.scss'; class GlossaryPartial extends Component { static getLinks(anchors) { return anchors.map(anchor => <p key={anchor.TEXTNODE} className="glossary-link"><Link to={anchor.URL}>{anchor.TEXTNODE}</Link></p>); } render() { const { data } = this.props; const { HEADER, ANCHORS, IMAGE, } = data; return ( <div className="home-glossary"> <div className="container home-glossary__container"> <div className="row"> <div className="col-md-12"> <h2>Glossary</h2> <p className="ta-center">Not sure what something means? Find terms from our library sorted A-Z.</p> <div className="row"> <div className="col-md-8"> <div className="card card--glossary"> <h3 className="card__title">{HEADER}</h3> { GlossaryPartial.getLinks(ANCHORS) } <Link className="btn btn-primary" to={LINKS.GLOSSARY}>View All</Link> </div> </div> <div className="col-md-4"> <img className="glossary-icon" src={IMAGE} alt="SendGrid Glossary" /> </div> </div> </div> </div> </div> </div> ); } } export default GlossaryPartial; ================================================ FILE: src/components/Group/index.jsx ================================================ import { Link } from 'gatsby'; import React from 'react'; import _ from 'lodash'; function Group(props) { const sort = _.sortBy(props.edges, [function (o) { return o.node.frontmatter.order; }]); return ( <div className="group-links"> {sort.map((doc) => { const { permalink, title, } = doc.node.fields; const docIsVisible = !!doc.node.frontmatter.navigation.show; return docIsVisible ? ( <Link key={permalink} to={permalink} dangerouslySetInnerHTML={{ __html: title }} /> ) : null; })} </div> ); } export default Group; ================================================ FILE: src/components/Libaries/index.jsx ================================================ import React from 'react'; import LIBRARIES from '../../constants/libraries'; import './libaries.scss'; function Libaries() { return( <div className="for-devs-libraries container ta-center"> <div className="card is-centered"> <h2>Open Source Libraries</h2> <div className="is-p">Prebuilt libraries and sample code for popular languages.</div> <div className="for-devs-libraries__languages"> {LIBRARIES.map(lib => ( <div key={lib.NAME} className="for-devs-libraries__lang"> <a className="for-devs-libraries__lang-link" key={lib.NAME} href={lib.URL} rel="noopener noreferrer" target="_blank"> <img src={lib.IMG} alt={lib.NAME} /> </a> </div> ))} </div> </div> </div> ); } export default Libaries; ================================================ FILE: src/components/Libaries/libaries.scss ================================================ @import '../../scss/global/variables'; @import '../../scss/global/mixins'; .for-devs-libraries .card { display: block; } .for-devs-callouts .card { box-shadow: 8px 10px 0 0 darken($slate, 6%); } .for-devs-libraries__languages { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 -10px; } .for-devs-libraries__lang { width: 25%; @media (max-width: $width-mobile) { width: 100%; } a { margin: 12px 15px; background: $mantis; display: block; border-radius: 35px; padding: $scaledown-3 $scale-0; transition: all 0.1s ease-in-out; &:hover { background: #009D4C; transform: translateY(-1px); } } img { vertical-align: middle; height: 50px; } } ================================================ FILE: src/components/NavMain/NavMain.scss ================================================ @import '../../scss/global/variables'; @import '../../scss/global/mixins'; .nav-wrap { background: $white; position: sticky; top: 0; z-index: 100; } .nav-wrap.has-sub-nav { margin-bottom: $scaleup-6; } .nav-main { position: relative; padding: 2px $scale-base-up-04; display: flex; border-bottom: 1px solid rgba(#a8b9d5, 0.6); box-shadow: 0 2px 14px 0 rgba(122,150,195,.1); z-index: 2; @media (max-width: $width-medium) { flex-direction: column; } } .nav-main__mobile { display: flex; width: calc(100% - 334px); @media (max-width: $width-medium) { flex-direction: column; max-height: 0; overflow: hidden; width: 100%; } } .nav-main__mobile.in { @media (max-width: $width-medium) { max-height: 1000px; } } .nav-item { font-size: 14px; font-weight: 600; margin: 0 $scale-base-up-06; @media (max-width: $width-large) { margin: 0 $scale-base-up-02; } @media (max-width: $width-medium) { margin: 0 $scale-base-down-01; } @media (max-width: $width-medium) { font-size: 24px; font-weight: 300; line-height: normal; border-bottom: 1px solid $slate-10; margin: 0; width: 100%; } } .nav-main__plain { color: $dark-blue; padding: $scale-base-up-02 0; &:hover { color: $primary; } @media (max-width: $width-medium) { display: block; } } .nav-secondary__link { color: $secondary; &:hover { color: $primary; } @media (max-width: $width-medium) { display: block; margin: $scale-base-up-03; padding: $scale-base-down-01 $scale-base-up-02; font-size: 14px; font-weight: 400; text-align: center; color: $primary; text-decoration: none; background-color: transparent; border: 2px solid $primary; border-radius: $scale-base-down-03; outline: 0; transition: all .2s ease-in-out; &:hover { color: $primary; background-color: $light-blue; border-color: $primary-hover; } } } .nav-center { align-items: center; display: flex; flex: 1; justify-content: center; @media (max-width: $width-medium) { flex-direction: column; align-items: flex-start; width: 100%; } .nav-item:first-of-type { margin-left: 0; } .nav-item:last-of-type { margin-right: 0; } } .nav-right { align-items: center; display: flex; .nav-item { margin: 0; @media (max-width: $width-medium) { border: 0; } } @media (max-width: $width-medium) { align-items: flex-start; width: 100%; } @media (max-width: $width-small) { flex-direction: column; } } .nav-right .nav-item--btn { font-size: 14px; text-align: center; margin-left: $scale-base-up-02; @media (max-width: $width-medium) { border: 0; margin: $scale-base-up-03 0 0; order: -1; } a { display: inline-block; padding: $scale-base-down-01 $scale-base-up-02; font-weight: 400; color: $white; text-decoration: none; background-color: $primary; border: 2px solid $primary; border-radius: $scale-base-down-03; outline: 0; transition: all .2s ease-in-out; @media (max-width: $width-medium) { display: block; margin: 0 $scale-base-up-03; } &:hover { color: $white; background-color: $primary-hover; border-color: $primary-hover; } } } .nav-main__toggle { display: none; position: absolute; top: 30px; right: $scale-base-up-04; font-size: $scale-base-up-01; font-weight: 600; color: $primary; border: 0; padding: 0; @media (max-width: $width-medium) { display: inline-block; } } .nav-main__menu__closer { display: none; position: relative; width: $scale-base-up-03; height: $scale-base-up-03; overflow: hidden; &::before, &::after { position: absolute; height: 2px; width: 100%; top: 50%; left: 0; margin-top: -1px; background-color: $primary; content: ''; } &::before { transform: rotate(45deg); } &::after { transform: rotate(-45deg); } } .in { .nav-main__menu { display: none; } .nav-main__menu__closer { display: block; } } .nav-main__logo { padding: $scaleup-4 0; background-image: url('https://sendgrid.com/brand/sg-twilio/sg-twilio-lockup.svg'); background-position: 0; background-repeat: no-repeat; background-size: 150px auto; display: block; height: 33px; width: 334px; text-align: right; position: relative; @media (max-width: $width-small) { background-size: 112px auto; width: 277px; } @media (max-width: $width-small-mobile) { background-size: 93px auto; width: 240px; } } .nav-main__help-center { text-transform: capitalize; display: inline-block; padding: 3px 8px 0; border-left: 2px solid $slate-40; color: $slate-40; position: absolute; line-height: 1; right: 0; top: 30px; font-size: 18px; @include colfax(600); @media (max-width: $width-small) { font-size: $scale-0; } @media (max-width: $width-small-mobile) { font-size: 14px; } } ================================================ FILE: src/components/NavMain/index.jsx ================================================ import React, { Component } from 'react'; import { Link } from 'gatsby'; import LINKS from '../../constants/pageLinks'; import { AuthCtx } from '../withUser'; import './NavMain.scss'; class NavMain extends Component { constructor(props) { super(props); this.state = { showMenu: false, }; this.toggleMenu = this.toggleMenu.bind(this); this.closeMenu = this.closeMenu.bind(this); } toggleMenu() { this.setState(prevState => ({ showMenu: !prevState.showMenu })); } closeMenu() { this.setState({ showMenu: false }); } render() { const { showMenu, } = this.state; const menuState = showMenu ? 'in' : ''; return ( <nav className="nav-main"> <Link className="nav-main__logo" onClick={this.closeMenu} to="/"> <span className="nav-main__help-center">Knowledge Center</span> </Link> <button type="button" className={`nav-main__toggle js-menu-toggle ${menuState}`} onClick={this.toggleMenu} > <span className="nav-main__menu">Menu</span> <span className="nav-main__menu__closer" /> </button> <div className={`nav-main__mobile ${menuState}`}> <div className="nav-center"> <div className="nav-item"> <a className="nav-main__plain" onClick={this.closeMenu} href={LINKS.SUPPORT}> Support </a> </div> <div className="nav-item"> <Link className="nav-main__plain" onClick={this.closeMenu} to={LINKS.FOR_DEVELOPERS}> Developers </Link> </div> <div className="nav-item"> <a className="nav-main__plain" onClick={this.closeMenu} href={LINKS.STATUS}> Status </a> </div> <div className="nav-item"> <Link className="nav-main__plain" onClick={this.closeMenu} to={LINKS.RELEASE_NOTES}> Release Notes </Link> </div> </div> <div className="nav-right"> <div className="nav-item"> <AuthCtx.Consumer> {({ user }) => ( user ? ( <a className="nav-secondary__dashboard" href={LINKS.APP}>Dashboard</a> ) : ( <a className="nav-secondary__link" href={LINKS.APP}>Sign In</a> ) )} </AuthCtx.Consumer> </div> <div className="nav-item nav-item--btn"> <a className="nav-main__login" href={LINKS.PRICING}> Start Free </a> </div> </div> </div> </nav> ); } } export default NavMain; ================================================ FILE: src/components/NavSub/NavSub.scss ================================================ @import '../../scss/global/variables'; .nav-sub { background: $slate-02; border-bottom: 1px solid $slate-10; position: relative; z-index: 1; } .docsfor-developers .nav-sub, .for-developers .nav-sub { margin-bottom: 0; @media (max-width: $width-small) { .input-text-wrap.is-search, .breadcrumb { margin-bottom: 0; } } } ================================================ FILE: src/components/NavSub/index.jsx ================================================ import React from 'react'; import Search from '../Search'; import BreadCrumbs from '../BreadCrumbs'; import './NavSub.scss'; const SubNav = (props) => ( <div> <div className="nav-sub"> <div className="container-lg"> <div className="row"> <div className="col-md-8"> <BreadCrumbs {...props} /> </div> <div className="col-md-4"> <Search /> </div> </div> </div> </div> </div> ); export default SubNav; ================================================ FILE: src/components/Rating/Rating.scss ================================================ @import '../../scss/global/variables'; @import '../../scss/global/mixins'; .rating { color: $slate-20; font-size: 28px; padding: 0; span { margin: 0 $scaledown-7; &:hover { cursor: pointer; } } .is-filled { color: $mango; } } .rate-this-doc { background: $slate-02; display: inline-block; margin: $scale-0 0; padding: $scaledown-3 $scaleup-3; &__success { @include colfax(600); } } ================================================ FILE: src/components/Rating/index.js ================================================ import React from 'react'; import './Rating.scss'; import { AuthCtx } from '../withUser'; class Rating extends React.Component { constructor(props) { super(props); this.ratingVals = [ 1, 2, 3, 4, 5 ]; this.state = { rating: 0, hasRating: false, } } componentDidMount() { this.dataLayer = window.dataLayer || []; } rateDoc = user => (e) => { const rating = parseInt( e.target.dataset.rating ); const userID = user ? user.userid : false; this.setState({ rating, hasRating: true, }) analytics.track("Doc Rated", { docID: window.location.pathname, userID, // SendGrid userID or false rating }); } getStars() { return this.ratingVals.map(rating => { const isSelected = rating <= this.state.rating ? 'is-filled' : ''; return ( <span key={rating} className={isSelected} data-rating={rating} onMouseEnter={() => { this.setState({rating}) }} onMouseLeave={() => { this.setState({rating: 0}) }} >★</span> ) }); } render() { return ( <div className="card card__feedback ta-center"> <div className="card__inner"> <h3 className="card__title" >Share Your Feedback</h3> <p>Let us know how we’re doing! Please rate this page:</p> <div className="rate-this-doc"> <AuthCtx.Consumer> {(ctx) => ( <React.Fragment> {this.state.hasRating ? ( <p className="rate-this-doc__success"> You’re the best! Thanks for helping us improve. 🙌 </p> ) : ( <div className="rating" onClick={this.rateDoc(ctx.user)}> {this.getStars()} </div> ) } </React.Fragment> )} </AuthCtx.Consumer> </div> <p>If you require immediate assistance from Twilio SendGrid, please <a href="https://support.sendgrid.com" title="contact our support team" target="_blank" rel="noopener noreferrer">contact our support team</a>. If you’ve spotted a documentation problem, please <a href="https://github.com/sendgrid/docs/issues/new" title="open a GitHub Issue" target="_blank" rel="noopener noreferrer">open a GitHub Issue</a>! </p> <p> Please note, we cannot resolve account and login issues reported on GitHub. <a href="https://support.sendgrid.com" title="Contact support" target="_blank" rel="noopener noreferrer">Contact support</a> for account assistance. </p> <p> Thanks for helping us improve our docs! </p> </div> </div> ); } } export default Rating; ================================================ FILE: src/components/ReleaseNotes/ReleaseKey.jsx ================================================ import React from 'react'; function ReleaseKey() { return ( <div className="release-notes-key m-bottom-8"> <div className="release-notes-key__icon is-size-h5"> <div className="icon-ui" /> UI Update </div> <div className="release-notes-key__icon"> <div className="icon-api" /> API Update </div> <div className="release-notes-key__icon"> <div className="icon-partners" /> Partners Update </div> <div className="release-notes-key__icon"> <div className="icon-price" /> Price Update </div> <div className="release-notes-key__icon"> <div className="icon-expert-services" /> Expert Services </div> </div> ); } export default ReleaseKey; ================================================ FILE: src/components/ReleaseNotes/ReleaseNotePost.jsx ================================================ import React from 'react'; import _ from 'lodash'; import RehypeReact from 'rehype-react'; import Callout from '../../componentsMarkdown/Callout'; import CodeGroup from '../../componentsMarkdown/CodeGroup'; const renderAst = new RehypeReact({ createElement: React.createElement, components: { 'call-out': Callout, 'code-group': CodeGroup, }, }).Compiler; const ReleaseNotePost = ({ node }) => ( <div key={node.frontmatter.date} className="release-note m-bottom-4"> <div className="release-row"> <div className="icons"> {node.frontmatter.releaseType.map(type => <div key={type} className={`icons__icon icon-${type}`}>{type}<br />update</div>)} </div> <div className="html-ast p-bottom-7"> <h2 id={_.kebabCase(node.frontmatter.date)} className="is-size-h1" > <a href={`#${_.kebabCase(node.frontmatter.date)}`} className="anchor" data-slug={_.kebabCase(node.frontmatter.date)}> <svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"> <path fillRule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" /> </svg> </a> {node.frontmatter.date} </h2> {renderAst(node.htmlAst)} </div> </div> </div> ); export default ReleaseNotePost; ================================================ FILE: src/components/SEO/index.jsx ================================================ import React, { Component } from 'react'; import { Helmet } from 'react-helmet'; import config from '../../../data/SiteConfig'; class SEO extends Component { static capitalizeFirstLetter(str) { const strArray = str.split(' '); for (let i = 0, x = strArray.length; i < x; i += 1) { strArray[i] = strArray[i][0].toUpperCase() + strArray[i].substr(1); } return strArray.join(' '); } render() { const { postNode, postType } = this.props; const image = config.ogImage; const sitePath = config.siteUrl + config.pathPrefix; // These will be set differently for a doc or page let title; let permalink; let description = false; if (postType === 'category') { const { docType, category, } = postNode.pathContext; title = SEO.capitalizeFirstLetter(`${docType.replace('-', ' ')} | ${category.replace('-', ' ')}`); } else if (postType === 'doc') { const { seo } = postNode.frontmatter; permalink = sitePath + postNode.fields.permalink; if (seo) { title = seo.title ? seo.title : postNode.title; description = seo.description ? seo.description : false; } else { ({ title } = postNode.fields); } } else { permalink = sitePath + postNode.location.pathname; ({ title } = this.props); ({ description } = this.props); } const schemaOrgJSONLD = [ { '@context': 'http://schema.org', '@type': 'WebSite', url: sitePath, name: config.siteTitle, alternateName: config.siteTitleAlt ? config.siteTitleAlt : '', }, { '@context': 'http://schema.org', '@type': 'WebPage', url: permalink, name: title, alternateName: config.siteTitleAlt ? config.siteTitleAlt : '', headline: title, image: { '@type': 'ImageObject', url: image, }, description, }, ]; return ( <Helmet> <title>{`${title} | ${config.siteTitle}`} {/* General tags */} {/* Schema.org tags */} {/* OpenGraph tags */} {postType === 'doc' ? : null} {description ? : null} {/* Twitter Card tags */} ); } } export default SEO; ================================================ FILE: src/components/Search/index.jsx ================================================ import React, { Component } from 'react'; import _ from 'lodash'; import STARWARS from '../../constants/starWars'; import config from '../../../data/SiteConfig'; import './search.scss'; class Search extends Component { componentDidMount() { const container = document.querySelector('.search-hero') || false; const prefix = process.env.NODE_ENV === 'development' ? '' : '/docs'; window.docsearch({ apiKey: '621c583d8098d07c471dbaf6c2178e56', indexName: 'sendgrid_hc', inputSelector: '.search-query', debug: false, // Set debug to true if you want to inspect the dropdown queryHook(query) { if (!container) { return; } const starKeys = Object.keys(STARWARS); const matches = starKeys.filter(val => _.includes(query, val)); if (matches.length) { const gif = STARWARS[matches[0]]; container.classList.add('star-wars'); container.style.backgroundImage = `url('${prefix}${gif}')`; } else { container.classList.remove('star-wars'); container.style = 'none'; } }, transformData(hits) { const updatedUrlHits = hits.map(((hit) => { const rootUrl = config.env === 'development' ? config.siteUrl + config.pathPrefix : config.siteUrl; hit.url = hit.url.replace('#___gatsby', ''); hit.url = hit.url.replace('#gatsby-focus-wrapper', ''); hit.url = hit.url.replace(rootUrl, ''); if (hit.anchor === '___gatsby' || hit.anchor === 'gatsby-focus-wrapper') { hit.anchor = ''; } return hit; })); // modify hits return updatedUrlHits; }, }); } render() { return (
); } } export default Search; ================================================ FILE: src/components/Search/search.scss ================================================ @import '../../scss/global/mixins'; @import '../../scss/global/variables'; .input-text-wrap [type="text"] { border-radius: 0; height: initial; } .input-text-wrap .input-btn { display: none; } .input-text-wrap .search-hero__query { @include colfax(400); color: $slate-60; background-image: none; &::placeholder { color: $slate; } &:focus { &::placeholder { color: transparent; } } } .search-hero__bg #query:focus { border: none; } .search-docs .algolia-autocomplete { width: 100%; } ================================================ FILE: src/components/SocialLinks/SocialLinks.css ================================================ .social-links { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: center; align-items: center; margin: 15px 0; } .social-links > div { margin: 5px 15px; } .share-count { text-align: center; } ================================================ FILE: src/components/SocialLinks/index.jsx ================================================ import React from 'react'; import SOCIAL_LINKS from '../../constants/socialLinks'; function SocialLinks() { const links = SOCIAL_LINKS.map(item => ( {item.TEXTNODE} {item.TEXTNODE} )); return (
{ links }
); }; export default SocialLinks; ================================================ FILE: src/components/StatusPage/index.jsx ================================================ import React, { Component } from 'react'; import axios from 'axios'; class MainLayout extends Component { constructor(props) { super(props); this.state = { status: false, }; } componentWillMount() { axios.get('https://3tgl2vf85cht.statuspage.io/api/v2/status.json') .then(res => { this.setState({ status: res.data, }); }) .catch(error => console.log(error)); } render() { const { status, page, } = this.state.status; if (!this.state.status || status.indicator === 'none') { return null; } const alertType = status.indicator === 'minor' ? 'warning' : 'danger'; return (

{status.description}. Learn More

); } } export default MainLayout; ================================================ FILE: src/components/StatusPage/statusPage.scss ================================================ ================================================ FILE: src/components/layout/NoHeaderFooter.jsx ================================================ import React from 'react'; export default class NoHeaderFooter extends React.Component { render() { const { children, location, } = this.props; const pathClass = location.pathname.replace(/\/docs\\|\//g, ''); const classNames = `docSearch-content docs-wrap ${pathClass}`; return (
{children}
); } } ================================================ FILE: src/components/layout/index.jsx ================================================ import React from 'react'; import NavMain from '../NavMain'; import StatusPage from '../StatusPage'; import Footer from '../Footer'; import withUser from '../withUser'; import SubNav from '../NavSub'; import '../../scss/style-guide.scss'; function MainLayout(props) { const { children, location, subNav, } = props; const pathClass = location.pathname.replace(/\/docs\\|\//g, ''); const classNames = `docSearch-content docs-wrap ${pathClass}`; const renderFooter = location.pathname.indexOf('/api-reference') === -1 ?