Skip to content
This repository has been archived by the owner on Dec 22, 2019. It is now read-only.

Unable to get Campaigns working #19

Closed
GrandadEvans opened this issue Jun 11, 2014 · 2 comments
Closed

Unable to get Campaigns working #19

GrandadEvans opened this issue Jun 11, 2014 · 2 comments

Comments

@GrandadEvans
Copy link

Hi Bogardo,

Thanks for this brilliant tool but I am hoping you could give me an example of how to include a campaign id. I have had a number of attempts but I cannot get it right.

Neither of these work and I'm hoping you can point me in the right direction (I would have asked on the Laravel forum but it is moving and laravel.io isn't working).

$message->data('X-Mailgun-Campaign-Id', "{'o:campaign': '001_invitation_requests'}");
$message->data('o:campaign', '001_invitation_requests');
$message->data('X-Mailgun-Campaign-Id', '001_invitation_requests');

Thanks in advance and Thanks again for the repo.
John

@Bogardo
Copy link
Owner

Bogardo commented Jun 11, 2014

Hi John,

The problem is that the data() method adds the passed data (and key) as data with the v: prefix.
Thus $message->data('o:campaign', '001_invitation_requests'); becomes:
'v:o:campaign', '001_invitation_requests'.

I'm currently adding all the remaining o: options, specified in the Mailgun documentation, to the package.
This way, adding a campaign ID to a message would be as simple as:

$message->campaign('001_invitation_requests');

Or

$message->campaign(array('id-1', 'id-2', 'id-3'));

Mailgun accepts a maximum of 3 campaign id's per message

@GrandadEvans
Copy link
Author

You, Sir, are a star! This now works perfectly.

Thank you so much
John

Bogardo added a commit that referenced this issue Jul 12, 2014
- Enable/Disable DKIM Signatures
- Enable/Disable Tracking
- Enable/Disable Click tracking
- Enable/Disable Open Tracking

This is a follow-up for #19 (@GrandadEvans)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants