Jump to content

API : Send Custom Email to Customer


Erik

Recommended Posts

This is probably very simple. I've tried looking and can't seem to figure it out.

 

I'd like to create a new email template and deploy it *specific to a customer* from our API. So that the customer name variable (and others) can be used.

 

So I could send the email id and customer id via the API code and it just sends that email with that customers variables filling in all the blanks.

Link to comment
Share on other sites

Are you just looking to send an email to one customer, or a number of them?

It looks like the sendemail API can handle what you're after (kind of), but it can't be singled out for just one customer.

Not sure WHY this was done this way, honestly, but it is what it is.

Alternatively, you can grab the information you're after from the DB, put it in your message that way. No, it's not templated, and it's a pretty ugly hack to doing this, but it may be the only way, for now. to do this.

Link to comment
Share on other sites

https://developers.whmcs.com/api-reference/sendemail/ Set "customtype" to the type of email template that you created. Set "messagename" to the email template name. Set the "id" to the customer id or if it is a service template set it to the service id. Then in the template just use the usual variables as shown on the template page.

 

That would work for any customer you feed in. If you really need it for just "specific customer" ( one customer ), you could just do the same and name it special for that customer. Or use the template if/else statements to customize it for the specific customer: {if $client_id eq 11111 }Hey Joe, this is your specific message{/if}

Link to comment
Share on other sites

Erik,

 

This is probably very simple. I've tried looking and can't seem to figure it out.

I'd like to create a new email template and deploy it *specific to a customer* from our API. So that the customer name variable (and others) can be used.

So I could send the email id and customer id via the API code and it just sends that email with that customers variables filling in all the blanks.

perhaps i'm missing the point, but is there any need for an API solution for this? :?:

 

e.g., couldn't you just use the Mass Mail feature of WHMCS, put this one client into their own client group, and then compose (and save if you intend to re-use it) the message - you'd have access to the client merge fields, so you could use their name etc in the content of the emails. :idea:

Link to comment
Share on other sites

perhaps i'm missing the point, but is there any need for an API solution for this? :?:

 

e.g., couldn't you just use the Mass Mail feature of WHMCS, put this one client into their own client group, and then compose (and save if you intend to re-use it) the message - you'd have access to the client merge fields, so you could use their name etc in the content of the emails. :idea:

 

Not surprised. I asked for a way to do this via API and then someone questions it and instead gives me a way to do it through WHMCS? :roll:

 

We use a call center and it's far easier for them to use our custom app with a few WHMCS API access points so that they are not toggling back and forth. It works great, but we need this one feature. I didn't explain this before because I didn't think it was relevant or necessary, but yes.. we need an API solution.

Link to comment
Share on other sites

Not surprised. I asked for a way to do this via API and then someone questions it and instead gives me a way to do it through WHMCS? :roll:

you wouldn't necessarily be the first person on here to ask for a solution using one method, when there is a way to do it using another that they perhaps hadn't thought of... :roll:

 

however, i'll leave you to solve your API solution yourself. :)

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