Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Used to send a bulk email campaign. It supports scheduling of the campaign (if a schedule is not specified, the message is queued up immediately).

...

  • string SendNewsletter(string accessKey, int listID, int newsletterID, Option[] options)
    • accessKey: access key obtained using the LoginFromId method
    • newsletterID: Id of the message returned by the WS_MailUpSend.CreateNewsletter
    • options: an array of key/value pairs for options setting
      • from_email: a string containing the sender email address. If not specified, the default value for the list will be used
      • from_name: a string containing the sender name. If not specified, the default value for the list will be used
      • clear_stats: a boolean value to enable/disable the deletion of statistics referred to previous mailings of the same message
      • send_to: a mandatory string indicating to whom the message will be sent. If send_to=ALL the message is sent to all subscribers, if send_to=RECIPIENTS the message is sent to specific email addresses, if send_to=GROUPS the message is sent to subscribers to specific groups
      • recipients: a string indicating the recipients of the message. Its content depends on the value assumed by "send_to". If send_to = ALL, "recipients" parameter is ignored and the message is sent to all the recipients in the list; if send_to=RECIPIENTS, "recipients" parameter contains a list of email addresses separated by the ";" character; if send_to=GROUPS, the "recipients" parameter contains the IDs of the recipient groups, separated by the ";" character 
      • exclude: a string containing the IDs of the groups to be excluded from the sending, separated by the ";" character
      • filters: a string containing the IDs of the filters separated by the ";" character, to be used to retrieve the recipients of the message
      • filters_as: a string indicating how to apply the filters: if filters_as=AND, all the conditions in the filters have to be met; if filters_as=OR, at least one of them
      • deliverydt: a string containing date and time of scheduled delivery, in the format yyyyMMddHHmmss. If not specified, the sending starts immediately, and in case another sending is in progress the message is queued
      • timezone: an integer indicating the time zone
      • campo1… campo<nn> = in case the "recipients" parameter contains a list of email addresses, you can indicate one or more personal data fields to be updated. Each option "campo<nn>" is a string containing the values for the personal data field <nn> referred to the email addresses indicated in the "recipients" parameter. Values must be separated by the ";" character

...

Recipient fields (merge tags)

It is important that the You can pass to the system values that will be saved in the recipient database as Recipient fields, and can be used in the message as merge tags (dynamic fields).

The number of elements indicated for each "campo<nn>" parameter corresponds to must match the number of addresses in the "recipients" parameter. E.g.

For example, let's say the message must be is sent to three email addresses: recipients. The recipients parameter will look as follows:

Code Block
recipients=johnsmith@example.com;pauljohnson@example.com;anntaylor@example.com

If name and surname are specified in campo1 and campo2, they will have to be detailed as follows:
 

Now let's assume that you want to pass to the system the recipients' first and last name as part of the API call. Let's also assume that those fields are saved in the first two Recipient fields (campo1 and campo2). The API call will have to include 3 items for each semi-colon separated array of values:

Code Block
campo1=John;Paul;Ann

...


campo2=Smith;Johnson;Taylor


In case of empty personal data fields, the number of elements must always be the same; in . In the example below, there are no personal data associated to empty values are passed for the second email addressrecipient:

Code Block
campo1=John;;Ann

...


campo2=Smith;;Taylor

Code samples

Code Block
languageruby
titleRuby
# Refer to https://mailup.atlassian.net/wiki/display/mailupapi/MailUp+RubyGem for gem information.
require 'mailup'
m = MailUp::Send.new('username', 'password')
m.send_newsletter(:newsletterID => 3, "Options" => {:from_email => '..."})
# => <SendNewsletterResult><errorCode>0</errorCode><errorDescription></errorDescription>...</SendNewsletterResult>"

...