Link Search Menu Expand Document

Sendgrid Functionality and Limitations

Authored by: Lili Cohen

Sendgrid: Functionality and Limitations

The official Sendgrid Handlebars documentation does not specify many of the desired functionality NHM requires, this documentation will help to clarify what configurations are possible and not possible.

Possible Functionalities

The following are tools that can be used:

  • HTML Elements

  • Inline CSS

  • Custom fonts integration

  • Using hosted images

  • Dynamic objects and substitutions both basic and deep (i.e. )

  • Conditionals that show/hide/render html and objects

    • If, Else, Else If
    • If with a root
    • Unless
    • greaterThan
    • lessThan
    • Equals
    • notEquals
    • And
    • Or
    • Length
  • Nested Conditionals

    •     
             
            <p></p>
             
          
             
            <p></p>
             
          
      
  • Iteration of objects (each)

    •     
         <p>People:</p>
             
            <p></p>
             
          
      
  • Conditionals that compare an object value to an object and a non-object (strings, integers, etc.).

    •     
          
          
      
  • Object failsafes (i.e using an object that does not exist or is routed incorrectly will result in not displaying the object but will not affect the overall email functionality or cause errors)

  • Date formatting

  • Multiple API Keys

Not Possible Functionalities

By following the official Handlebars.js documentation and comparing it to the Sendgrid Handlebars documentation, there are certain concepts and functionalities that cannot be fullfilled in Sendgrid’s handlebars.js.

The following are tools that cannot be used:

  • Custom Helpers / Register Helper functions.

    • Handlebars.registerHelper('loud', function (aString) {
          return aString.toUpperCase()
      })
      
  • Multiple email senders (current email sender: ticketing@nhm.org).

  • The total size of your email, including attachments, must be less than 30MB.

  • The total number of recipients must no more than 1000. This includes all recipients defined within the to, cc, and bcc parameters, across each object that you include in the personalizations array.

  • The total length of custom arguments must be less than 10000 bytes.

  • Unicode encoding is not supported for the from field.

  • The to.name, cc.name, and bcc.name personalizations cannot include either the ; or , characters.