Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Missing argument 2 for CS_REST_Transactional_SmartEmail::send() #73

Open
LiamKarlMitchell opened this issue May 31, 2018 · 2 comments

Comments

@LiamKarlMitchell
Copy link

Forgive me if this is already well known, I'm a new user to this API.
Yes, the release and history.md do have a note about the breaking changes.

The Campaign Monitor example given through the "Developer Instructions" on the admin screens may need to be updated?

Perhaps a quick note to it for the PHP tab as the send methods do not have a default value for the ConsentToTrack.

Note: $consent_to_track is now mandatory as a breaking change to the API. (2nd arg to CS_REST_Transactional_SmartEmail::send).

$result = $wrap->send($message, "Yes");
@stutotman
Copy link

Hey @LiamKarlMitchell,

Thanks for reaching out about this. We currently have a change in progress to update the remaining language examples on the Developer Instructions page and will have this out shortly.

Hopefully this PHP wrapper has the information you need in the meantime. If you require any further information you can also visit our API docs here --> https://www.campaignmonitor.com/api/transactional/

Apologies for any convenience and stay tuned for the pending changes!

@LiamKarlMitchell
Copy link
Author

@stutotman Good to know thanks,
Yes I found those API docs useful.
One thing that was not immediately apparent was how to tell if the email was a success from the result.

After digging through the inheritance I found the was_successful() method.

if (!$result->was_successful()) {
	throw new Exception("Unable to send email: " + $result->http_status_code);
}

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants