The setEmailCampaignAttribute() method is used to specify a field for the given campaign.
Attributes that can be set for a campaign are:
- name
- subject
- send_friend
- from_label
- support_email (behaves the same as reply_to_email)
- redirect_url
- mail_date
Note: Only one attribute can be set per call.
Input
[vrtypens:setEmailCampaignAttributeArgs]
session_id [xsd:string] (required)
Your API session id.
campaign_id [xsd:int] (required)
The id of the campaign whose attribute is being set.
name [xsd:string] (required)
The name of the attribute being set.
value [xsd:string] (required)
The attribute’s new value.
Output
[xsd:boolean]
Examples
PHP
$vr->setEmailCampaignAttribute( array( 'session_id' => $sid, 'campaign_id' => $campId, 'name' => 'subject', 'value' => 'A New API Subject Line', ) );
Ruby
vr.setEmailCampaignAttribute({ 'session_id' => sid, 'campaign_id' => cid, 'name' => 'subject', 'value' => "A New API Subject Line", })
Java
String name = "subject"; String value = "A New API Subject Line"; SetEmailCampaignAttributeArgs setEmailCampaignAttributeArgs = new SetEmailCampaignAttributeArgs(); setEmailCampaignAttributeArgs.setSession_id(sessionID); setEmailCampaignAttributeArgs.setCampaign_id(campaignID); setEmailCampaignAttributeArgs.setName(name); setEmailCampaignAttributeArgs.setValue(value); vr.setEmailCampaignAttribute(setEmailCampaignAttributeArgs);
C#/.NET
String name = "subject"; String value = "A New API Subject Line"; SetEmailCampaignAttributeArgs setEmailCampaignAttributeArgs = new SetEmailCampaignAttributeArgs(); setEmailCampaignAttributeArgs.setSession_id(sessionID); setEmailCampaignAttributeArgs.setCampaign_id(campaignID); setEmailCampaignAttributeArgs.setName(name); setEmailCampaignAttributeArgs.setValue(value); vr.setEmailCampaignAttribute(setEmailCampaignAttributeArgs);
Perl
$vrapi->setEmailCampaignAttribute( { session_id => $sid, campaign_id => $cid, name => 'subject', value => 'A New API Subject Line', } );