Jump to content

Email API question


yrochon

Recommended Posts

Let me get this straight; from the doc :

 

 

This command is used to send an email to a customer.

 

The id you pass depends on what you want to send. For example if you are requesting the system to send a product related email template, you need to pass the Service ID it should relate to in the id field, while if you are requesting an invoice related email template to be sent, you would pass the Invoice ID, etc...

 

Attributes

 

messagename - unique name of the email template to send from WHMCS
id - related ID number to send message for

 

Example Command

 

$postfields["action"] = "sendemail";
$postfields["messagename"] = "Hosting Account Welcome Email";
$postfields["id"] = "1";

 

 

... is

 

$postfields["id"]

 

always the client id? If not, what is it, and to whom the message will be sent to?

Link to comment
Share on other sites

And I have another question; We need to create message templates for a custom module and we notice that messages may contain Smarty syntax. Is it possible to send data through the API call that can be treated by the message template and processed? For example, have the message template display a message like

 

You may call at {$phone_number} and speak with {$representative_name} for more information

 

and invoke this with

 

$postfields["action"] = "sendemail";
$postfields["messagename"] = "My Custom Email Template";
$postfields["id"] = "1";
$postfields['phone_number] = '111-222-3333';
$postfields['representative_name'] = 'Jon Doe';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated