Send email
From ePrize Developers Wiki
(New page: <pre>Request representation: profile: {profile}, prize: {prize}, friend: [ [name: {friend-name}, email: {friend-email}], ... ] The prize and friend keys are optional, but if the template ...) |
|||
(7 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
- | + | {{RESTfulAPI | |
- | + | |crumbs=[[API Home Page]] :: [[Mail]] | |
- | + | |summary=Send a predefined email to a user. | |
- | + | ||
- | [ | + | These emails must be configured with your API Key. There are 3 types of emails that can be sent. The values for {template-id} are: |
- | ... | + | |
- | + | * win | |
+ | * reg | ||
+ | * taf | ||
+ | |||
+ | 'win' is a win email. This will required a prize parameter in the request. 'taf' is a tell-a-friend email and will require the friend values in the request. 'reg' is a registration thank you email. All email will require the profile parameter to be sent. | ||
The prize and friend keys are optional, but if the template requires them, the request may fail. | The prize and friend keys are optional, but if the template requires them, the request may fail. | ||
- | Response: | + | Email templates must conform to HelloWorld standards. Client defined templates are not supported. In addition, email delivery limits are enforced by HelloWorld and are not under client control. This API is a request to deliver an email, not a guaranteed email delivery system. |
- | 200 OK | + | |resource=/v1/{apikey}/email/{template-id} |
+ | |methods=POST | ||
+ | |resourceargs='''apikey''': Your [[API Key]]. | ||
+ | |||
+ | '''template-id''': One of the three email template names: | ||
+ | |||
+ | * win | ||
+ | * reg | ||
+ | * taf | ||
+ | |||
+ | |paramsrequired='''profile''': A canonical profile resource. Required for all templates. | ||
+ | |||
+ | '''prize''': A prize resource that the user has won. Required when using the 'win' template. | ||
+ | |||
+ | '''friendName''': Name of the friend receiving the tell-a-friend email. Required when using the 'taf' template. | ||
+ | |||
+ | '''friendEmail''': Email address of the friend receiving the tell-a-friend email. Required when using the 'taf' template. | ||
+ | }} | ||
+ | |||
+ | |||
+ | {{RESTfulExample | ||
+ | |title=Successful Response | ||
+ | |summary=This demonstrates a successful response. | ||
+ | |request=profile: {profile}, | ||
+ | prize: {prize}, | ||
+ | friendName: {friend-name} | ||
+ | friendEmail: {friend-email} | ||
+ | |responsecode=200 OK | ||
+ | |response=<?xml version="1.0" encoding="UTF-8" ?> | ||
+ | <result>1</result> | ||
+ | }} | ||
+ | |||
- | Response on invalid or missing fields | + | == Response on invalid or missing fields == |
- | + | ||
- | + | 400 Bad Request | |
- | + | ||
- | + | ||
- | + | == Response if limit reached or security violation == | |
- | + | 403 Forbidden |
Current revision
Summary
Send a predefined email to a user.
These emails must be configured with your API Key. There are 3 types of emails that can be sent. The values for {template-id} are:
- win
- reg
- taf
'win' is a win email. This will required a prize parameter in the request. 'taf' is a tell-a-friend email and will require the friend values in the request. 'reg' is a registration thank you email. All email will require the profile parameter to be sent.
The prize and friend keys are optional, but if the template requires them, the request may fail.
Email templates must conform to HelloWorld standards. Client defined templates are not supported. In addition, email delivery limits are enforced by HelloWorld and are not under client control. This API is a request to deliver an email, not a guaranteed email delivery system.
Resource
/v1/{apikey}/email/{template-id}
Valid Methods
POST
Resource Arguments
Note: resource arguments are always required.
apikey: Your API Key.
template-id: One of the three email template names:
- win
- reg
- taf
Parameters Required
profile: A canonical profile resource. Required for all templates.
prize: A prize resource that the user has won. Required when using the 'win' template.
friendName: Name of the friend receiving the tell-a-friend email. Required when using the 'taf' template.
friendEmail: Email address of the friend receiving the tell-a-friend email. Required when using the 'taf' template.
Example: Successful Response
Summary
This demonstrates a successful response.
Request
profile: {profile}, prize: {prize}, friendName: {friend-name} friendEmail: {friend-email}
Response
HTTP Status Code: 200 OK
<?xml version="1.0" encoding="UTF-8" ?> <result>1</result>
Response on invalid or missing fields
400 Bad Request
Response if limit reached or security violation
403 Forbidden