Location

enum Location

The OpenTracking.Location enum represents where the open tracking pixel should be placed in the email.

If the open tracking setting is enabled by default on your SendGrid account and you want to disable it for this specific email, you should use the .off case.

  • off: Disables open tracking for the email.
  • bottom: Places the open tracking pixel at the bottom of the email body.
  • at: Places the open tracking pixel at a specified substitution tag. For instance, if you wanted to place the open tracking pixel at the top of your email, you can specify this case with a tag, such as .at(tag: "%open_tracking%"), and then in the body of your email you can place the text %open_tracking% at the top. The tag will then be replaced with the open tracking pixel.
  • off

    Disables open tracking for the email.

    Declaration

    Swift

    case off
  • Places the open tracking pixel at the bottom of the email body.

    Declaration

    Swift

    case bottom
  • Places the open tracking pixel at a specified substitution tag. For instance, if you wanted to place the open tracking pixel at the top of your email, you can specify this case with a tag, such as .at(tag: "%open_tracking%"), and then in the body of your email you can place the text %open_tracking% at the top. The tag will then be replaced with the open tracking pixel.

    Declaration

    Swift

    case at(tag: String)