Package

net.gutefrage.mandrill

messages

Permalink

package messages

Visibility
  1. Public
  2. All

Type Members

  1. final case class MergeVar(name: String, content: String) extends Product with Serializable

    Permalink
  2. final case class Recipient(email: Email, name: Option[Name] = None, type: Option[RecipientType] = None) extends Product with Serializable

    Permalink

    email

    The email address of the recipient

    name

    The optional display name to use for the recipient

  3. final case class RecipientMergeVars(recipient: Recipient, merge_vars: Seq[MergeVar]) extends Product with Serializable

    Permalink

    Represents the merge_vars array in the API definition.

    Recipient MergeVars

    Represents the merge_vars array in the API definition.

    API doc

    per-recipient merge variables, which override global merge variables with the same name.

    recipient

    The recipient associated with the given merge_vars. See Recipient

    merge_vars

    The specific merge_vars for the given recipient. See MergeVar

    See also

    SendTemplate

  4. 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

    Permalink

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

    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

  5. final case class SendTemplateResponse(_id: String, email: String, status: Status, rejectReason: Option[RejectReason]) extends Product with Serializable

    Permalink

    Response from the /messages/send-template.json endpoint.

    Send-Template Response

    Response from the /messages/send-template.json endpoint.

    _id

    Mandrill id for the performed action

    email

    Receiver email

    status

    Status of the sent email

    rejectReason

    Optional reject reason if the email could not be sent

Value Members

  1. object Recipient extends Serializable

    Permalink
  2. object SendTemplate extends Serializable

    Permalink
  3. object SendTemplateResponse extends Serializable

    Permalink

Ungrouped