cancel
Showing results for 
Search instead for 
Did you mean: 

How does one schedule an email campaign from the Java API?

SOLVED
Highlighted
Occasional Contributor

How does one schedule an email campaign from the Java API?

I have a list, and I can programatically add a new contact to it.

 

I can use the Java API to find a campaign, and update it with a from, to, reply-to, subject, footer, etc.

 

But two pieces are missing for me:

  1. How do I associate the email list with the campaign, as I do on the Constant Contact website when I click on the "+" to "Send to lists"?
  2. How do I run the campaign from the Java api? I reasoned that since the campaign has a "setNextRunDate" method, setting it and saving it would cause the campaign to be scheduled. No such luck.

Thanks for your help,


Remon

 

 

4 REPLIES 4
Occasional Contributor

Re: How does one schedule an email campaign from the Java API?

Er.... I looked a bit further into the posts and discovered that sending a campaign requires that I sign on. That's a complete non-starter for me. I would have to sign on three times a day every day including weekends. How do I cancel my account?

Honored Contributor

Re: How does one schedule an email campaign from the Java API?

Hello,

 

Here's how to resolve your issues:

 

1. You can add lists to a campaign using the following code:

// We will assume that camp is the campaign that you wish to send and that campaignSerivce is an instance of the EmailCampaignService class.

camp.setSentToContactLists(Arrays.asList(new SentToContactList("LIST ID"),new SentToContactList("LIST ID"),new SentToContactList("LIST ID")));
campaignService.updateCampaign(camp);

For #2, there is a separate service for campaign scheduling. You can schedule a campaign using the following code:

EmailCampaignScheduleService service = new EmailCampaignScheduleService(ACCESS_TOKEN, API_KEY);
service.addSchedule("CAMPAIGNID",new EmailCampaignSchedule("ISO-8601 Timestamp"));

Hopefully this should be enough to help you get back on track. If you have any questions or issues, please let us know!

 

Sincerely,

Elijah G.
API Support Engineer
Honored Contributor

Re: How does one schedule an email campaign from the Java API?

My apologies for not replying to your second post in my reply. The actual scheduling and sending of campaigns can absolutely be done through our API and does not require you to log in to our web interface. However, if you are still in a position where you need to cancel your account, the best option is to contact our Billing team. They are available from 7AM to 9PM Eastern by phone and by email.

  • 855-229-5506

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Contributor

Re: How does one schedule an email campaign from the Java API?

Wow, thanks!  It looked from some of the posts that this was not possible.  You saved me a lot of time.