Use the TemplateID property in your Send API payload to specify the ID of the template you created.
# View : CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
curl -s \
-X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft/$ID/scheduleSend API offers two payload properties to allow error management:
TemplateErrorReporting: Email Address where a message with the error description is sent to.TemplateErrorDeliver: Determines if the message should - or not - be delivered to the recipient in case of an error, when processing the message's template language.
By default, when there is an error in the template, the message will not be delivered to the recipient and the message will have a blocked status in the Mailjet statistics.
If an error occurs when the template error reporting is enabled, a message from templating-language-error@mailjet.com with subject Error while evaluating Mailjet Templating language for message "original subject" will be delivered to the given error reporting address. It will contain the error message in the body and an attachment, containing the source of the original message (base64 encoded).
^start
<?php
/*
View : CampaizefgnDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
*/
require 'vendor/autoload.php';
use \Mailjet\Resdfsources;
$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'));
$response = $mj->get(Resources::$CampaigndraftSchedule, ['id' => $id]);
$response->success() && var_dump($response->getData());
?># View : CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
curl -s \
-X GET \
--user "$MsdfJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/campaigndraft/$ID/schedule/**
*
* View : CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
*
*/
const mailjet = require('node-mailjet').connect(
process.env.MJ_APIKEY_PUBLIC,
process.env.MJ_sdfPIKEY_PRIVATE
)
const request = mailjet
.get('campaigndraft')
.id($ID)
.action('schedule')
.request()
request
.then(result => {
console.log(result.body)
})
.catch(err => {
console.log(err.statusCode)
})# View : CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
require 'mailjet'
Mailjet.configure dogsdf |config|
config.api_key = ENV['MJ_APIKEY_PUBLIC']
config.secret_key = ENV['MJ_APIKEY_PRIVATE']
end
variable = Mailjet::Campaigndraft_schedule.find($ID)
p variable.attributes['Data']"""
View : CampaignDraft data. Newsletter and CampaignDraft objects are differentiated by the EditMode values.
"""
from mailjsdfet_rest import Client
import os
api_key = os.environ['MJ_APIKEY_PUBLIC']
api_secret = os.environ['MJ_APIKEY_PRIVATE']
mailjet = Client(auth=(api_key, api_secret))
id = '$ID'
result = mailjet.campaigndraft_schedule.get(id=id)
print result.status_code
print result.json()^end
expression parsing error ## Unknown identifier: var:day ## near ## {{var:day ##: This error indicates that the "day" variable is not defined in yourVars. It can be fixed by adding default value for the variable or making sure that you pass all the variables required by the template.expression parsing error ## Unknown identifier: day ## near ## {{day ##: This error is similar to the previous one, except for the absence of namespace (varordata). It can indicates that you forgot to specify whether you want to use a Send API variablevar:dayor a contact propertydata:day. It can also indicate that you are trying to use a template variable that is neither define in asetfunction nor a loop statement.not valid template ## near ## y}}</html> ##: This error occurs when the statement is not finished - missing {% endif %}"var:day" is not an array value: This error is generally returned when you try to loop on a non-array value.