Update email message

Update Email Message

Update a specific email message within a survey campaign.

Endpoint

POST /v5/survey/{survey_id}/surveycampaign/{campaign_id}/emailmessage/{emailmessage_id}

Authentication is required for all requests. See Authentication.

Path Parameters

survey_id
integer
required
The ID of the survey that owns the campaign.
campaign_id
integer
required
The ID of the survey campaign that contains the email message.
emailmessage_id
integer
required
The ID of the email message to update.

Request Body

All parameters are optional. Send only the fields you want to change.

from
object
The sender details.
replies
string
The reply-to email address.
subject
string
The subject line of the email message.
message_type
string
The message format. Accepted values: plaintext, html. All messages created via the API default to plaintext. Setting this to html enables an HTML email with an automatically syncing plaintext backup -- you only need to provide the HTML body.
body
object
The email body content.
send
boolean
Set to true to send the message immediately when the call is made. This parameter does not need to be set to false to prevent sending -- omitting it is sufficient.
footer
string
The footer text appended to the message. Typically includes a physical address and unsubscribe link using Alchemer merge tags.
embed_question
boolean
Set to true to embed the first survey question in the body of the email. See Embed Survey in an Email.
disable_styles
boolean
Set to true to disable the default email message styles. See Change Format of Email Campaign Message.

Response

result_ok
boolean
Returns true if the email message was updated successfully.
data
object
The updated email message object.

Examples

Request
curl -X POST "https://api.alchemer.com/v5/survey/123456/surveycampaign/100000/emailmessage/100000?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET" \
  --data-urlencode "subject=Reminder: Please take our survey" \
  --data-urlencode "from[name]=Alchemer" \
  --data-urlencode "from[email]=surveys@alchemer.com"
Response
{
  "result_ok": true,
  "data": {
    "id": "100000",
    "type": "EmailMessage",
    "subtype": "reminder",
    "message_type": "plaintext",
    "medium": "Email",
    "invite_identity": "282478",
    "status": "Building",
    "from": {
      "email": "surveys@alchemer.com",
      "name": "Alchemer"
    },
    "subject": "Reminder: Please take our survey",
    "body": {
      "text": "Hi, I am currently running a study. Please fill out this survey.\n\n[invite(\"survey link\")]\n\nThank You!",
      "html": ""
    },
    "footer": "This message was sent by [account(\"physical address\")].\nTo unsubscribe, click below:\n[invite(\"unsubscribe link\")]",
    "embed_question": false,
    "disable_styles": false,
    "date_created": "2013-09-01 16:16:58",
    "date_modified": "2013-09-01 16:25:39"
  }
}

Notes on Reminder and Thank You Emails

Reminder emails

Scheduled reminders — Reminder emails with a defined schedule in the Alchemer UI (e.g., send 1 day after previous email) cannot be triggered via API.
Mixed campaigns — If a campaign includes at least one scheduled reminder that has not yet been sent, unscheduled reminders in that campaign also cannot be sent via API.
Unscheduled reminders — Reminder emails without a schedule work as expected when triggered via API, as long as no scheduled reminders are present in the campaign.

Thank you emails

Using this endpoint with send=true will send a Thank You email to respondents who have completed the survey and have not already received the Thank You email. Respondents who completed previously and already received it will not receive a second one. Respondents who have not completed the survey will not receive it.