# Mailing

Mailing introduction.

# Send Email

Attribute: send_email

Our built-in mailing mechanism is designed to document conversations. It means that with each set of messages, a contact needs to be provided.

# send_email is a simple operation
# that points to the internal mailing integration
type: Operation

# define the pointers to the
# internal app & app action
selector:
    app: mailing
    app_action: send_email

# define the send_email payload
payload:
    # contact information that will
    # be attached to the email
    email:
        type: redis
        rkey_type: hash_map
        data: get_contact_info:email

    firstname:
        type: redis
        rkey_type: hash_map
        data: get_contact_info:firstname

    lastname:
        type: redis
        rkey_type: hash_map
        data: get_contact_info:lastname

    mobile:
        type: redis
        rkey_type: hash_map
        data: get_contact_info:mobile

    # free input that will be parsed into the contact information
    # in case of missing VCF
    query:
        type: redis
        rkey_type: hash_map
        data: get_contact_info:message_data:message:body

    # Email's subject
    subject:
        type: raw
        data: New Email

    # List of base 64 encoded messages
    messages:
        type: redis
        rkey_type: hash_map
        data: messages:messages:messages_b64

    # Email's destination address
    to:
        type: struct
        data: User.Emails.0