+49 69 83008980 service@xqueue.com
Benötigen Sie Hilfe?

Im Maileon Help-Center finden Sie umfassende Dokumentationen zu unserem System.

Beliebte Suchanfragen: Importe | Rest-API | Integrationen | SMS

Create Dispatching

Sie sind hier:
This method can only be applied to mailings of type TRIGGER
Create the trigger dispatching information for a given mailing. This method needs to be called before activating a trigger mailing.

PUT https://api.maileon.com/1.0/mailings/:mailingid/dispatching

The body has the media type application/vnd.maileon.api+xml and contains dispatching options with the following attributes:

Attribute Required Description
type yes The type of the trigger mail dispatch plan, this can be one of ‘SINGLE’ or ‘MULTI’.SINGLE: The trigger mailing will be instantly sent when a given transaction event is received. MULTI: This represents an intervall scheduling where several contacts can receive the same (personalized) mailing at once.
event yes, if (type = SINGLE) or (type = MULTI and target = EVENT) The ID of the transaction event that is used to either start the instant mailing or to controll the mass mailing.
target yes, if (type == MULTI) Defines the target group of a intervall mailing. This can either be ‘EVENT’, ‘CONTACTFILTER’, or ‘RSS’. EVENT: Contacts are selected based on receiving a given transaction event. CONTACTFILTER: Contacts are selected by using a given contact filter. RSS: Contacts are selected by using a given contact filter, RSS2Email trigger attributes are allowed.
speed_level no, default is “LOW” Valid values are ‘LOW’, ‘MEDIUM’, and ‘HIGH’
interval yes, if (type == MULTI) This defines the interval in which the mailing is sent. This can be one of ‘HOUR’, ‘DAY’, ‘WEEK’, or ‘MONTH’
day_of_month yes, if (type== MULTI and interval = MONTH) Sets the day of the month the mailing will be sent. Range: [1..31] If you set a larger number than the month has days, the last day in the month will be used.
day_of_week yes, if (type== MULTI and interval = WEEK) Sets the day of the week the mailing will be sent. Range: [1..7] 1 = Sunday 2 = Monday 3 = Tuesday 4 = Wednesday 5 = Thursday 6 = Friday 7 = Saturday
hours yes, if (type== MULTI and interval = (MONTH or WEEK or DAY)) Sets the tour of the day the mailing will be sent. Range: [0..23]
minutes yes, if (type== MULTI and interval = (MONTH or WEEK or DAY or HOUR)) Sets the minute of the hour the mailing will be sent. Range: [0..59]
contact_filter_id yes if target = ‘CONTACTFILTER’ od ‘RSS’ Sets contact filter ID
start_trigger no, default is ‘false’ If set to true, the trigger will be instantly activated after setting the dispatching options.
rss_unique_feature no, yes if target = ‘RSS’ Defines the features that define an item as unique. Valid values are “DEFAULT”, “PUBDATE”, “TITLE”, and “LINK”, whereas “DEFAULT” is the combination of title, description and link. If any of those changes, the item will be recognized as new.
rss_feed_url no, yes if target = ‘RSS’ The URL of the RSS feed.
rss_order_by no, yes if target = ‘RSS’ Defines the attribute to order elements by. Valid are “PUBDATE”, “TITLE”, and “LINK”
rss_order_asc no, yes if target = ‘RSS’ Defines if the order direction is ASC or DESC. If ‘true’ elements are handled in ascending order.
rss_min_new_entries no, yes if target = ‘RSS’ The minimal number of new entries to trigger the RSS2Email mailing.
delivery_limit no The maximum of mailings a repeipient should receive in a given period. Default is 0, which means unlimited.
delivery_limit_unit no, yes if delivery_limit != 0 The time period for the delivery limit. Can be one of *’DAY’, ‘WEEK’, ‘MONTH’, or ‘YEAR’.

Attribute Examples

Setting up the mailing to be sent as soon as an Event with ID 58 is received:

< ?xml version="1.0"?>
<dispatch_options>
  <type>SINGLE</type>
  <event>58</event>
  <speed_level>LOW</speed_level>
  <start_trigger>false</start_trigger>
</dispatch_options>

Setting up the mailing to be sent as soon as an Event with ID 1628 is received and instantly set the mailing active:

< ?xml version="1.0"?>
<dispatch_options>
 <type>SINGLE</type>
 <event>1628</event>
 <speed_level>HIGH</speed_level>
 <start_trigger>true</start_trigger>
</dispatch_options>

Setting up the mailing to be sent as soon as an Event with ID 1628 is received, set a limit of 5 mails per week:

< ?xml version="1.0"?>
<dispatch_options>
 <type>SINGLE</type>
 <event>1628</event>
 <speed_level>HIGH</speed_level>
 <start_trigger>false</start_trigger>
 <delivery_limit>5</delivery_limit>
 <delivery_limit_unit>WEEK</delivery_limit_unit>
</dispatch_options>

Setting up a mailing to be sent every hour at the 30th minute, using a contact event as selection base:

< ?xml version="1.0"?>
<dispatch_options>
  <type>MULTI</type>
  <target>EVENT</target>
  <event>1628</event>
  <interval>HOUR</interval>
  <minutes>30</minutes>
</dispatch_options>

Setting up a mailing to be sent every month at the 15th day at 12:30 o’clock, using an contact filter as selection base:

< ?xml version="1.0"?>
<dispatch_options>
  <type>MULTI</type>
  <target>CONTACTFILTER</target>
  <contact_filter_id>18</contact_filter_id>
  <interval>MONTH</interval>
  <day_of_month>15</day_of_month>
  <hours>12</hours>
  <minutes>30</minutes>
</dispatch_options>

Setting up a mailing to be sent every week at the Sunday 12:30 o’clock, using an contact filter as selection base:

< ?xml version="1.0"?>
<dispatch_options>
  <type>MULTI</type>
  <target>CONTACTFILTER</target>
  <contact_filter_id>18</contact_filter_id>
  <interval>WEEK</interval>
  <day_of_week>1</day_of_week>
  <hours>12</hours>
  <minutes>30</minutes>
</dispatch_options>

Setting up an RSS2Email triggermailing:

<dispatch_options>
  <type>MULTI</type>
  <start_trigger>false</start_trigger>
  <target>RSS</target>
  <interval>HOUR</interval>
  <hours>0</hours>
  <minutes>0</minutes>
  <contact_filter_id>2765</contact_filter_id>
  <rss_unique_feature>DEFAULT</rss_unique_feature>
  <rss_feed_url>http://www.spiegel.de/schlagzeilen/tops/index.rss</rss_feed_url>
  <rss_order_by>PUBDATE</rss_order_by>
  <rss_order_asc>true</rss_order_asc>
  <rss_min_new_entries>10</rss_min_new_entries>
</dispatch_options>

Example

* Hostname api.maileon.com was found in DNS cache
*   Trying 212.6.132.213...
* Connected to api.maileon.com (212.6.132.213) port 80 (#0)
> PUT /1.0/mailings/123/dispatching HTTP/1.1
Host: api.maileon.com
Content-type: application/vnd.maileon.api+xml
Accept: application/vnd.maileon.api+xml
Authorization: ***redacted***
Content-Length: 160

* upload completely sent off: 160 out of 160 bytes
< HTTP/1.1 200 OK
< Server: nginx/1.4.6 (Ubuntu)
< Date: Thu, 10 Sep 2015 10:16:02 GMT
< Content-Type: application/vnd.maileon.api+xml
< Content-Length: 0
< Connection: keep-alive
< 
* Connection #0 to host api.maileon.com left intact

Result

status code: 200 OK
No body data.
result type: NULL

success (Status code: 200 – OK)

Inhaltsverzeichnis