Support > Repository > Sending and receiving e-mail > Send e-mail (specify e-mail template at run time)
ja | en

You can prepare multiple mail templates and specify which templates to use when sending.

Before reading this page,Send mail (fix mail template)Please look through.

Change model

To dynamically change the mail template, add an item to hold "mail template" on the model side.

As shown in Figure 1, add the "mail template" item.The referenced model is a mail template model (jfcmailtemplate) provided by Wagby as standard.Reference destination model item is "explanation".(Figure 2)

Figure 1 Adding items to reference mail templates
Fig. 2 Reference setting of mail template item

Mail settings

Here, I will prepare the "Send Mail" button on the detail display screen.Timing of transmission is "Mail send button".We will make the button name "mail for customer".

The point is to specify the item name (added in Figure 1 instead of fixed value) in the mail template item field.In this case, surround the item name with "$ {" and "}".

${mailtemplate}
Fig. 3 Mail settings for detailed display

Mail Template Settings

Log on as a system administrator to the application you built.Configure detailed settings for the mail template set in Fig. 3.Register new mail templates.(FIG. 4, FIG. 5)

Please set a value that does not duplicate "ID" with other mail templates."Description" is used as a mail template option.Set up easy-to-understand content.

Fig. 4 Mail template setting screen (1)

Subject, sender, addressee, e-mail body (text area)PlaceholderCan be set.(In Fig. 5, it is used for the addressee and the body.)

Fig. 5 Mail template setting screen (2)

send an emailbefore, Set which mail template to use.(FIG. 6)
The option is the "explanation" item set in Figure 4.

Figure 6 Selecting a mail template

"Send mail" button is prepared on the detailed display screen.(FIG. 7)
A mail is sent by pressing the button.

Fig. 7 "Send mail" button prepared on the detailed display screen