Support > Repository > Sending and receiving e-mail > Send mail (fix mail template)
ja | en

Prepare the mail destination, body, etc. as a template. You can send mail with its contents.

To set up e-mail transmission, follow the procedure below.

  1. Button setting and build by Designer.
  2. "Mail Template" setting to be done with Wagby application (build)

The details of each procedure will be explained here.

Designer settings

Open the "Mail> Send" tab.You can set mail transmission at the timing of each screen function. Here, we will explain an example of automatic mail delivery to all sales departments at "registration time" of customer data.

Setting items Description Input example
send an email Activate this check to activate the mail sending function. (check)
Transmission timing You can select "When processing is completed" or "Mail send button".Automatic mail delivery when processing is completed.When you prepare the e-mail send button, you send e-mail when you press the button.In general, select "When processing is completed" if it involves operations such as registration, update and deletion, and "Mail send button" on the detail screen. When processing is completed
Send mail button When the transmission timing is "Mail send button", the button for mail transmission is arranged with the name set in the button name. (check)
Mail Template Item It becomes the identifier (ID) of "mail template" to be described later.Please choose a unique name with a combination of alphanumeric characters. announceForSalesTeam
After sending mail
Display a message
A message that mail transmission succeeded or failed is displayed on the screen.
Transmission conditions You can specify conditions for sending mail.If the conditions are not met, no mail will be sent.[More ...] ${status}==1
Action on success You can specify an expression to execute when mail transmission is successful.[More ...] ${count}=${count}+1
Action on failure You can specify an expression to execute when mail transmission fails.[More ...] ${status}=-1
Figure 1 Setting up automatic mail transmission at registration

Log on as a system administrator to the application you built.Make detailed settings for the mail template set in Fig. 1.Register new mail templates.(Figure 2)

Figure 2 New registration of mail template

This is the setting screen of the mail template.(FIGS. 3 and 4)

In "Applied Model", select "Customer". "Mail server" "Subject" "From" and so on.Please be sure to enter "Description".You can also specify a placeholder for each item.

basic configuration

This is the basic setting related to sending mail.

Setting items Required Description Input example
ID Specify the value of the mail template item set in Figure 1.This value becomes the key, and it is linked with the value in Fig. (Same as the setting value in Figure 1)
Applicable model classification Usually, select "user". user
Applicable model Specify the model to send this e-mail. client
Description Please specify the purpose, nature (transmission timing), destination etc etc of this mail template. (Free text)
subject Write the title of the mail to be sent.You can also include placeholders in the string. Information for $ {customer_p.name}
From Specify the mail address of the sender.You can also include placeholders in the string. info
${customer_p.createusermail}
Recipient Specify the mail address of the destination.You can also include placeholders in the string. sales
${customer_p.email}
Send individually to recipients Please read "When more than one recipient has been specified" to be described later. (Do not send individually when not set)
Cc Specify the carbon copy mail address.You can also include placeholders in the string. -
Bcc Specify the blind carbon copy mail address.You can also include placeholders in the string. -
Attachment Use the placeholder to specify the model item name corresponding to the attached file.We treat files registered in this item as attached files. ${customer_p.filename}
Maximum number of attachments Multiple attached files can be specified by using items in the repeating container as attachments, but by setting this value, it is possible to limit the maximum number of attached files. 10
Text form You can specify text mail, HTML mail, etc.In accordance with this specification method, the body that can be specifically entered is selected.If you specify this specification in the body of the mail, the appropriate entry field will be valid in the text area at the bottom so please list it there.(You can include placeholders in the text.) Text Only
Fig. 3 Mail template setting screen (1)
Fig. 4 Mail template setting screen (2)

Server> SMTP

This is the setting related to the (SMTP) server that performs transmission.For examples of settings of Gmail, Office 365, etc., please read "Mail server setting example".

Setting items Description Input example
Mail Server Specify the mail server.When omitting, use the value of "environment> mail> mail setting (common)> mail host name".You can add ": (colon)" after the mail server name and specify an arbitrary port number. mailserver.YOURCOMPANYNAME.co.jp
mailserver.YOURCOMPANYNAME.co.jp:587
smtp.gmail.com
protocol The mail server selects the corresponding protocol.Please contact your mail server administrator for details. SMTP
Using SMTP authentication Select whether or not the mail server will use SMTP authentication.When not selected, it will be "not used".Please contact your mail server administrator for details. (Unselected)
Authentication account Enter this when using SMTP authentication.
Authentication password Enter this when using SMTP authentication.
Fig. 5 Mail template setting screen (3)

Server> POP before SMTP7.5.1

POP before Set for SMTP authentication.(If you do not use this authentication method, leave this setting field blank.)

Setting items Description Input example
Authentication server POP before Specify the host name of the POP3 server used for SMTP authentication.When the host name is written here, POP before SMTP authentication will be used.
It is also possible to specify a port number by a colon delimiter after the server name.7.10
pop.YOURCOMPANYNAME.co.jp
protocol Specify either "POP 3" or "POP 3 over SSL".The default is "POP3". (Unselected)
APOP authentication Specify whether to use APOP or not.It is "not used" when it is omitted. (Unselected)
Authentication account Specify the account to authenticate the POP3 server.
Authentication password Specify the password of the account to authenticate the POP3 server.
Fig. 6 Mail template setting screen (4)

In the mail template, you can embed the value of the target model by specifying a special replacement character notation (place holder) to the mail server, subject, sender, addressee, body.

The format of the placeholder is "form>Placeholder".

Relationship with authority setting

If you set hidden permissions on items, placeholders also return null characters if you do not have permission.

Use repetitive items

You can specify repetitive items as "recipients" "Cc" "Bcc".You can send mail to multiple people.The format is as follows.

$ {Model name _ p. Item name. #}

Use item of repeating container

You can designate the items of the repeating container as "recipient" "Cc" "Bcc".You can send mail to multiple people.The format is as follows.

$ {Model name _ p. Repeating container name #. Mail address item name}

Repeat item, Repetition Container item setting example.

An example Output result (destination)
${customer_p.receiver.#} taro@jasminesoft.co.jp ,
jiro@jasminesoft2.co.jp ,
hanako@jasminesoft3.co.jp
${customer_p.report.#.email} taro@jasminesoft.co.jp,
jiro@jasminesoft2.co.jp,
hanako@jasminesoft3.co.jp
${customer_p.report.#.name} <${customer_p.report.#.email}> Jasmine Taro <taro@jasminesoft.co.jp>,
Jasmine Jiro <jiro@jasminesoft2.co.jp>,
Jasmine Hanako <hanako@jasminesoft3.co.jp>

Please be careful

  • You can not include the "#" notation in placeholders of the body of the mail.
  • Placeholders can not be specified for destinations and text on the list display or download screen.

We will register a new customer.(FIG. 7)

Figure 7 New customer registration screen

Mail is automatically sent when new registration is done normally.(FIG. 8)

Fig. 8 Automatic transmission of mail and new registration completion

In the mail transmission setting, the timing of transmission can be set as "mail transmission button".We prepare mainly on detailed display screen.

Fig. 9 E-mail sending setting with mail sending button pressed

On the detail screen, a mail transmission button is prepared as shown in Fig.

Figure 10 Mail send button

When "Display message after e-mail transmission" is enabled in Fig. 9, a message will be displayed as shown in Fig. 10 after e-mail transmission.

Figure 10 Mail transmission success message

When more than one recipient is specified

If you specify more than one recipient, you can see all destinations such as "manager01 @ xxx.yyy.zzz, manager02 @ xxx.yyy.zzz, manager 03 @ xxx.yyy.zzz" etc. in the received mail.If you want to send other recipients so that they can not be seen (send them individually to their respective destinations), enable the "Send individually to recipients" setting.

When "Send individually to recipient" is specified and the placeholder is applied to the addressee, the recipient information is read from the database. hereWhen the destination is zero, mail transmission is not performed.This operation can be suppressed by adding one address that can be transmitted without fail.

Include Japanese in recipients

"Sender" "To whom" "CC" "Bcc" can also contain Japanese.
(Example) "Wagby cheering supporters supporter @ wagby.com" etc.

It can also be specified with a placeholder.

${staff_p.lastupdateuser} <${staff_p.lastupdateusermail}>

Sending rule

The transmission rules at the time of address specification are as follows.

  • To is mandatory.Cc, Bcc are optional.
  • If any of To, Cc or Bcc has an incorrect mail address description, it will not be sent.
  • If there are duplications in To, Cc, Bcc, duplicates are excluded.There will not be multiple e-mails sent to the same e-mail address.

You can attach an item of file name type.It supports not only regular filename type items but also file name types in repeating containers.

Specifically, it is specified in placeholder format.The format is as follows.

$ {Model name _ p. Item name}
$ {Model name _ p. Container name. # Item name}

Here is an example.

${report_p.attachfile}
${report_p.container.#.attachfile}

Maximum number of attachments

You can specify "maximum number of attached files".If the number of attached files exceeds this number, an error occurs and mail is not sent.

(If "Maximum number of attached files" is blank, the number of attached files is not checked.)

Mail Server

Wagby itself does not have mail server function.Wagby's mail transmission is sent from the server on which the Wagby application is running, not from the client on which the browser is running, using the mail server specified at setup.If you do not receive e-mails, please check whether the server that is running Wagby application can communicate correctly to the specified mail server.

protocol

Wagby's compatible mail sending protocols are "SMTP" and "SMTPS (SMTP over SSL)".SMTP authentication is also supported.

When using Gmail as a mail server, you need to specify SMTPS as the protocol and set up SMTP authentication.

SMTP authentication supports "LOGIN" and "PLAIN" methods.(It does not correspond to "CRAM - MD 5", "DIGEST - MD 5", "NTLM" etc).)

You can specify the "button name" and "display condition" of the mail transmission button.

For details of setting, see "Screen function> Customize button name and display conditionPlease refer to.

Fig. 12 Mail send button and display condition

You can specify an expression to execute when mail transmission succeeds or fails.
The expression at the time of success and failure is an assignment form.Equal for substitution is required.

When incrementing the item "number of transmissions" at the time of sending mails, write as follows.

${mailsend_cnt}=${mailsend_cnt}+1

Multiple expressions can be written, separated by semicolons.

${mailsend_cnt}=${mailsend_cnt}+1;${status}=IF(${mailsend_cnt}==0,"Zero","Non-Zero")

Restriction of description

  • You can use functions in expressions, but aggregate functions such as SUM and COUNT can not be used.
  • #content can not be specified for model reference items.Only #id is available.
  • You can not use the item of the model as a condition to send e-mail with the download and list display function.Only "number of items" can be used as a placeholder for mail.As an expression that does not use model items, you can control by authority such as HASPRINCIPAL ("principal name").

Restriction of model definition

Model that set change history is setCan not describe processing on success/failure.(This restriction is planned to be improved by future Wagby.)

You can specify conditions for sending mail.If the conditions are not met, no mail will be sent.

When sending mail when model item "Status" is "1", it is written as follows.For condition judgment formula, two equals are required.

${status}==1

By combining with "action at the time of success", it is possible to set a flag at the time of mail transmission success, and control to make it impossible to transmit the mail at the second time if the flag is set.

Restriction of description

It is the same as "$ {content_ 10 _ name}".

By default, no retries are made when mail transmission fails.You can specify the number of retries and the interval in the next step.

  1. Prepare a new myMimeMailUtilities.properties.UTF8 file in the customize/resources folder.
  2. Add the following entries: _____ 0 The parameter jfc.retry.interval indicates the retry interval.The unit is millisecond.
    The parameter jfc.max.retry.count indicates the number of transmissions including retries.In this example, it is set to 10 times, and if the first mail transmission process fails, retry processing is performed up to 9 times.(Retry processing will be terminated when mail transmission is successful.)
  3. Save this file and do the build process.
Resource files with my prefix attached are combined at build time.For details, see "Wagby Developer Network (R7)> Customizing with Java> resource filePlease read.
This setting applies to all mail transmission.

As a standard, only the address specified in To is recorded in the mail transmission log (success and failure). The Cc and Bcc addresses can also be logged in the next step.

  1. Prepare a new myMimeMailUtilities.properties.UTF8 file in the customize/resources folder.
  2. Add the following entries: _____ 1 The parameters jfc.log.cc and jfc.log.bcc specify whether or not to log the addresses of Cc and Bcc, respectively.You can specify either or both at the same time.
  3. Save this file and do the build process.
Resource files with my prefix attached are combined at build time.For details, see "Wagby Developer Network (R7)> Customizing with Java> resource filePlease read.
This setting applies to all mail transmission.

Com.sun.mail.smtp.SMTPSendFailedException: Invalid sender address error

Please check whether the "sender" specified in the mail template is the same as the account when sending the server.On the mail server side, there is a possibility that it is set as an error if they do not match.