Send email to customers (tutorial)

Because the informations are scattered everywhere in the forum I decided to create a step by step tutorial.

  1. Create a custom field “Email Address” in your Customers Entity.

  2. In Automation Menu create an Action with the following settings

    Action Name:Send Email
    Action Type:Send Email
    Parameters:
    S M T P Server: your email service SMTP Server
    S M T P User: your email username (usualy is your email)
    S M T P Password: your email password
    S M T P Port: your email service Port
    To E Mail Address: [:To Address]
    Subject: [:subject]
    C C Email Addresses: [:To Address]
    From E Mail Address:
    E Mail Message: [:message]
    File Name: [:filename] (filaname is used to send attachment files read below)
    Delete File:
    Bypass Ssl Errors:
    Retry Count:
    Retry Minutes:


    I don’t recommend Gmail because it has very restricted security settings, but Outlook is working fine using this settings, or if you own domain name/hosting even better.

    S M T P Server: smtp-mail.outlook.com
    S M T P User: youremail
    S M T P Password: yourpassword
    S M T P Port: 25
    To E Mail Address:
    Subject:
    C C Email Addresses:
    From E Mail Address:
    E Mail Message:
    File Name:
    Delete File:
    Bypass Ssl Errors: False
    Retry Count:
    Retry Minutes:

  3. You implemment the action in the rule you want to execute (i used it for sending email to Delivery Customers as soon as their order is ready).


    Constraint:
    To Address: {ENTITY DATA:Customers:Emai| Address}
    subject: what ever you want for subject
    message: Your message (REMEMBER: Email message body does not support multiple lines)
    filename: attach files to email (read below)

If you want to send attachment with you email do the following steps:

a) In Printing menu add a printer with settings:

Printer Name:Print For Email
Printer Share Name / Port Name: .
Printer Type: Custom Printer -  Save to File Printer
Character Set:
RTL Support:None
Line Count:O
Line Character Count:42

In settings menu you must add the path that txt files are stored. You must have already create the folder /s

b) Create a ticket template
I use a simple one just for customers quick information

[LAYOUT]
-- General layout
<T>Coffee Shop
<C>***
<C>Date: [=FD(ADD('{TICKET DATE}',0),'dd/MM/yyyy')]
<C>Time: [=FD(ADD('{TIME}',0),'HH:mm')]|
{ENTITIES}
<C>Order #:{TICKET NO}  {TICKET TAG:SG}
<L00>{TICKET STATE:Status}
{ORDERS}
<F>=
<EB>
<J00>      Thank You
<CUT>
[DISCOUNTS]
<J00>{CALCULATION NAME} {CALCULATION AMOUNT}% |{CALCULATION TOTAL} €
[PAYMENTS]
[<J00>Change: |{CHANGE TOTAL} €]
<J00>{DESCRIPTION}
[ORDERS]
-- Default format for order
<J00>{QUANTITY} {NAME} ({PRICE TAG})|{TOTAL PRICE}
{ORDER TAGS}
[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}
[ORDERS:Void]
-- Nothing will print for void lines
[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE} €
[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}
[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME}
[<J00>Tel:{ENTITY DATA:Telephone} | Mobile:{ENTITY DATA:Mobile}]
[<J00>Address:{ENTITY DATA:DeliveryAddress}]     
<L>
<EB>
[<C00>Points: {ENTITY DATA:Points}]
[<C00>Account Balance: [=F(0-TN('{ENTITY BALANCE}'))] €]
<DB>
<L>
[TAXES]
<J00>{TAX NAME}|{TAX AMOUNT} €
[ENTITIES:Gift Certificate]
<C00>Card: {ENTITY NAME}
<C00>Balance: [=F(0-TN('{ENTITY BALANCE}'))] €
<L>

c) Add a print Job

d)Next go to the Rule and add the txt file path to filename

I hope this tutorial will help you … :smile:

9 Likes

once I changed this setting gmail began to work for me.
https://www.google.com/settings/security/lesssecureapps

2 Likes

and while I’m here you can set it up to be received as a text message on your phone

2 Likes

Can we send email in pdf format ?
how can we send email to a customer who request invoice after closing the ticket (in Resturant department)

Email supports printer tags. Can also save to file and send transaction file.

could you please show me your execute Email job Action

Hi this is my Email Action, as for the pdf you must have a pdf printer installer and set it to save with out asking.

1 Like

Is it possible to add a linebreak into the email? I have tried \r <br>

Maybe if you write the body in a script and use.a call there. Though I have not tried that.

It works if I use an ? prompt for the message and use \r but I don’t really want that popping up everytime. I will try using some sort of script.

Try \r\n instead of just \r

Hello,
I followed the instruction and I am able to send the email when requested. However the attached text document is blank. I think that it is because I did not create the folder properly.
Is it a specific kind of folder? I am not able to create a file with a name like yours.

I have a few questions.

The name of the file being saved and the name of the file that being emailed is delayed by 1 second. So it fails to send.

I don’t mind that issue, but I want to check whether customers have an email address registered before sending the email. Now it applies for all customers and shows an error for those customers without an email address.

Also I want to send the email each time a customer account transaction occurs. So I send the ticket total, which I figured out was {TICKET TOTAL}, but also the customer account balance, which I haven’t yet figured out. So I’d like some help on that as well.

UPDATE

So I managed to solve all those issues. But am currently tackling another one. Here are the solutions I found to the above issues.

  1. For the file issue, turn on high priority in the print job action.

  2. For checking customer’s emails: ‘{ENTITY DATA:Customers:Email Address}’!=""

  3. For the account balance: {ENTITY BALANCE:Customers}

But I also want to send customers updates when they make an account payment so they will be notified of their new balance. For some reason, using the doesn’t work when applied to the rule for the event “Account Transaction Document Created”.

Would be great if someone could tell me what’s wrong here.

image