Class/Object

net.gutefrage.mandrill.messages

SendTemplate

Related Docs: object SendTemplate | package messages

Permalink

case class SendTemplate(key: MandrillApiKey, template_name: TemplateName, to: Seq[Recipient] = Nil, template_content: Seq[TemplateContent] = Nil, message: Message = SendTemplate.Message(), send_at: Option[MandrillDateTime] = None) extends Product with Serializable

Mandrill Templates

Modelling the responses/requests for the /messages/send-template.json method

Every template defined in mandrill is represented by its own type.

A template has a name and a message object, which is represented by net.gutefrage.mandrill.messages.SendTemplate.Message.

The message object defines:

- the recipients - the recipients individual merge_vars (placeholders) - the global_merge_vars that are inserted in each template

JSON format

This is the minimal format that gets generated by our API

{
   "key": "the-api-key",
   "subject": "optional subject to override defaults in mandrill template",
   "template_name": "template-name",
   "template_content": [],
   "send_at": "YYYY-MM-DD HH:MM:SS",
   "message": {
     "to": [{
         "email": "test@example.com"
     }],
     "merge_vars": [
       {
         "rcpt": "test@example.com",
         "vars": [
            {
              "name": "SOME_LINK",
              "content": "https://www.example.com"
            }
         ]
       }
     ]
   }
}
key

A valid API key

template_name

The immutable name or slug of a template that exists in the user's account. For backwards-compatibility, the template name may also be used but the immutable slug is preferred.

template_content

Additional template content

message

An array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

send_at

When this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.

See also

https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template

https://mandrillapp.com/templates

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SendTemplate
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SendTemplate(key: MandrillApiKey, template_name: TemplateName, to: Seq[Recipient] = Nil, template_content: Seq[TemplateContent] = Nil, message: Message = SendTemplate.Message(), send_at: Option[MandrillDateTime] = None)

    Permalink

    key

    A valid API key

    template_name

    The immutable name or slug of a template that exists in the user's account. For backwards-compatibility, the template name may also be used but the immutable slug is preferred.

    template_content

    Additional template content

    message

    An array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

    send_at

    When this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def bcc(email: String, mergeVars: (String, String)*): SendTemplate

    Permalink

    Adds a new recipient for this template with header type BCC.

    Adds a new recipient for this template with header type BCC.

    TODO write usage examples

    email

    Recipient email

    mergeVars

    Optional variables for this recipient

    returns

    A new template with the recipient added

  6. def cc(email: String, mergeVars: (String, String)*): SendTemplate

    Permalink

    Adds a new recipient for this template with header type CC.

    Adds a new recipient for this template with header type CC.

    TODO write usage examples

    email

    Recipient email

    mergeVars

    Optional variables for this recipient

    returns

    A new template with the recipient added

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. val key: MandrillApiKey

    Permalink

    A valid API key

  13. val message: Message

    Permalink

    An array of template content to send.

    An array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block

  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def sendAt(schedule: DateTime): SendTemplate

    Permalink

    Schedules this template at the given point in time.

    Schedules this template at the given point in time. If you specify a time in the past, the message will be sent immediately.

    An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.

    schedule

    The time the message should be sent

    returns

    A new template with sendAt date

  18. val send_at: Option[MandrillDateTime]

    Permalink

    When this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format.

    When this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately. An additional fee applies for scheduled email, and this feature is only available to accounts with a positive balance.

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def templateContent(first: (String, String), rest: (String, String)*): SendTemplate

    Permalink

    Adds template contents to this template

    Adds template contents to this template

    TODO write usage examples

    first

    first template content item

    rest

    optional other template content items

    returns

    A new template with template content items added

  21. val template_content: Seq[TemplateContent]

    Permalink

    Additional template content

  22. val template_name: TemplateName

    Permalink

    The immutable name or slug of a template that exists in the user's account.

    The immutable name or slug of a template that exists in the user's account. For backwards-compatibility, the template name may also be used but the immutable slug is preferred.

  23. def to(email: String, mergeVars: (String, String)*): SendTemplate

    Permalink

    Adds a new recipient for this template.

    Adds a new recipient for this template.

    TODO write usage examples

    email

    Recipient email

    mergeVars

    Optional variables for this recipient

    returns

    A new template with the recipient added

  24. def to(recipient: Recipient, mergeVars: Seq[MergeVar] = Nil): SendTemplate

    Permalink

    Adds a new recipient for this template.

    Adds a new recipient for this template.

    TODO write usage examples

    recipient

    New recipient

    mergeVars

    Optional variables for this recipient

    returns

    A new template with the recipient added

  25. val to: Seq[Recipient]

    Permalink
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped