Section

enum Section

This enum represents the sections of an email that click tracking should be applied to. In general, you should use the .htmlBody case, as only the HTML body of an email can have clickable links.

If, for some reason, you want the URLs in the plain text body of an email to be tracked as well, you should use the .plainTextAndHTMLBodies case instead. Be aware, though, that having both sections tracked will result in long URLs showing up in the plain text body.

If click tracking is normally enabled on your SendGrid account and you want to disable it for this particular email, use the .off case.

  • off: If used, the setting will be disabled for this email.
  • htmlBody: If used, links in the HTML body of the email will be encoded and tracked.
  • plainTextAndHTMLBodies: If used, links in the HTML body and URLs in the plain text body will be encoded and tracked.
  • off

    If used, the setting will be disabled for this email.

    Declaration

    Swift

    case off
  • If used, links in the HTML body of the email will be encoded and tracked.

    Declaration

    Swift

    case htmlBody
  • If used, links in the HTML body and URLs in the plain text body will be encoded and tracked.

    Declaration

    Swift

    case plainTextAndHTMLBodies