Email notification templates
  • 09 Aug 2024
  • 5 Minutes to read
  • Dark
    Light

Email notification templates

  • Dark
    Light

Article summary

Zilliant CPQ sends email notifications about changes in opportunities and quotes, or when a manager approves a quote.

Configure email notification templates

  1. From the application left navigation area, select Administration.
  2. From the top navigation bar, select Content Management.
  3. Select conf > email from the list.
  4. Download the properties file for the language you want to configure.
  5. Make changes to email content and key-value pairs, then upload the file.

Default email text

Email subject

workItem.approval.needed.title=Approval needed for ${doc.type} "${doc.objectName}"

Email body
workItem.approval.needed.content=Dear ${user.firstName},<br><br>${sender.firstName} ${sender.lastName} just submitted a quote which requires your review and approval. The quote’s expires on <span style="color: red; font-weight: bold;">${doc.salesDocumentDateOfExpiry}</span> and therefore immediate attention is needed!
<div>
   <div><span>Quote ID:</span><span>${doc.quoteId}</span></div>
   <div><span>Name:</span><span>${doc.objectName}</span></div>
   <div><span>Quote Value:</span><span>${doc.includesDocumentHeaderPriceItem.documentHeaderPrice}</span></div>
   <div><span>Account</span><span>${doc.quoteContainedBy.objectName}</span></div>
</div>
<br>You can review the quote <a href="${doc.url}">here</a> or approve / reject using the below buttons:<br><br>${approvalButtons}<br><br><br><i>Powered by</i><br>
<div><img src="https://www.inmindcloud.com/wp-content/uploads/2018/08/In-Mind-Cloud-New-Logo-small.png"></img></div>
<div style="color: #00B0F0; font-size: 10px; font-style: italic;">This email was automatically sent from Zilliant CPQ.</div>

Email template examples

Email to the order creator when a business admin approves the order
portal.order.approved.title = Your Order ${doc.orderId} Has Been Approved
portal.order.approved.content = 
<body bgcolor="#F7F1E8">
   Dear ${user.firstName} ${user.lastName},<br><br>Order ID "${doc.orderId}" - for amount "${doc.orderTotal}" that you submitted has been approved and submitted by ${sender.firstName} ${sender.lastName}</p>
   <table style="background-color: rgb(255, 255, 255);">
      <tbody>
         <tr>
            <td style="width: 150px;">PO ID:</td>
            <td>${doc.poID}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Order:</td>
            <td>${doc.objectName}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Order Value:</td>
            <td>${doc.hasCurrency.objectName} ${doc.orderTotal}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Address:</td>
            <td><br></td>
         </tr>
         <tr>
            <td style="width: 150px;">Bill To:</td>
            <td>${doc.orderBillTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.address2AdditionalStreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Ship To To:</td>
            <td>${doc.orderShipTo.address1StreetPrefixName}&emsp;${doc.orderShipTo.addressStreet}&emsp;${doc.orderShipTo.addressCity}</td>
         </tr>
      </tbody>
   </table>
   <p><br><a href="${applicationURL}">Access Portal Application</a><br><br></p>
   <hr>
   This is a system-generated message. Please do not reply to this email.
   <p></p>
   <p><span style="color: #FBB116; font-weight: bold; font-style: italic;"><br></span></p>
   <p><span style="color: #FBB116; font-weight: bold; font-style: italic;">In Mind Cloud </span><i>Digital Sales Platform</i><br></p>
   <div><img src="https://f.hubspotusercontent30.net/hubfs/1797086/new%20logo%202021/IMC_LOGO_RGB_300x197.png" width="250" alt="IMC Logo"></div>
   <div style="color: #FBB116; font-size: 12px; font-style: italic;">This email was auto-generated. Please do not reply.</div>
   <p><br></p>
   <p></p>
Email to the order creator when a business admin rejects the order
portal.order.rejected.title = Your Order ${doc.orderId} Has Been Rejected
portal.order.rejected.content = Dear ${user.firstName} ${user.lastName},<br><br>Order "${doc.orderId}" that you submitted has been rejected by ${sender.firstName} ${sender.lastName}<br><br>PO ID:&emsp;&emsp;&emsp;${doc.poId}<br><br>Order:&emsp;&emsp;&emsp;${doc.objectName}<br><br>Order Value:&nbsp;&nbsp;&nbsp;&nbsp;${doc.hasCurrency.objectName} ${doc.orderTotal}<br><br>Address:&emsp;&emsp;Bill To:&emsp;${doc.orderBillTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.address2AdditionalStreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}<br><br>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Ship To:&emsp;${doc.orderShipTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}<br><br><a href="${applicationURL}">Access Portal Application</a><br><br>
<hr>
This is a system generated message. Please do not reply to this email.
Email to business admins when a user cancels an order that is submitted for review
portal.order.cancelled.title = Order ${doc.orderId} Has Been Cancelled
portal.order.cancelled.content = 
<body bgcolor="#F7F1E8">
   Dear ${user.firstName},<br><br>Order "${doc.orderId}" was submitted for your review, but has been cancelled by the submitter.<br><br>
   <hr>
   <span style="color: #FBB116; font-weight: bold; font-style: italic;">In Mind Cloud </span><i>Digital Sales Platform</i><br>
   <div><img src="https://f.hubspotusercontent30.net/hubfs/1797086/new%20logo%202021/IMC_LOGO_RGB_300x197.png" width="250" alt="IMC Logo"></img></div>
   <div style="color: #FBB116; font-size: 12px; font-style: italic;">This email was auto-generated. Please do not reply. You can access your application <a href="${activationLink}">here</a></div>
</body>
Email to business admins when a user submits an order for review
portal.order.reviewRequest.title = Order ${doc.orderId} (PO: ${doc.poId}) Has Been Submitted For Your Review
portal.order.reviewRequest.content = 
<body bgcolor="#F7F1E8">
   Dear ${user.firstName},<br><br>The following order has been submitted for your review:<br>
   <p></p>
   <table style="background-color: rgb(255, 255, 255);">
      <tbody>
         <tr>
            <td style="width: 150px;">PO ID:</td>
            <td>${doc.poID}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Order:</td>
            <td>${doc.objectName}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Order Value:</td>
            <td>${doc.hasCurrency.objectName} ${doc.orderTotal}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Address:</td>
            <td><br></td>
         </tr>
         <tr>
            <td style="width: 150px;">Bill To:</td>
            <td>${doc.orderBillTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.address2AdditionalStreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}</td>
         </tr>
         <tr>
            <td style="width: 150px;">Ship To To:</td>
            <td>${doc.orderShipTo.address1StreetPrefixName}&emsp;${doc.orderShipTo.addressStreet}&emsp;${doc.orderShipTo.addressCity}</td>
         </tr>
      </tbody>
   </table>
   <p><br></p>
   <p><br>You can review the details and place the order <a href="${doc.url}">here</a>
   <hr>
   <span style="color: #FBB116; font-weight: bold; font-style: italic;">In Mind Cloud </span><i>Digital Sales Platform</i><br>
   <div><img src="https://f.hubspotusercontent30.net/hubfs/1797086/new%20logo%202021/IMC_LOGO_RGB_300x197.png" width="250" alt="IMC Logo"></img></div>
   <div style="color: #FBB116; font-size: 12px; font-style: italic;">This email was auto-generated. Please do not reply. You can access your application <a href="${activationLink}">here</a></div>
</body>
Email to the order approver when a business admin approves the order, amends it and places the order, or places their own order
portal.order.approved.bizadmin.title = Your Order ${doc.orderId} (PO: ${doc.poId}) Has Been Submitted
portal.order.approved.bizadmin.content = Dear ${user.firstName} ${user.lastName},<br><br>Order "${doc.orderId}" (PO: ${doc.poId}) has been placed by you.<br><br>PO ID:&emsp;&emsp;&emsp;${doc.poId}<br><br>Order:&emsp;&emsp;&emsp;${doc.objectName}<br><br>Order Value:&nbsp;&nbsp;&nbsp;&nbsp;${doc.hasCurrency.objectName} ${doc.orderTotal}<br><br>Address:&emsp;&emsp;Bill To:&emsp;${doc.orderBillTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.address2AdditionalStreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}<br><br>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Ship To:&emsp;${doc.orderShipTo.address1StreetPrefixName}&emsp;${doc.orderBillTo.addressStreet}&emsp;${doc.orderBillTo.addressCity}
Commerce user or business admin submits an order inquiry
portal.inquiry.title = Inquiry ${doc.quoteId} Has Been Submitted
portal.inquiry.content = Dear ${user.firstName} ${user.lastName},<br><br>The following Inquiry has been submitted by you.<br><br>Inquiry ID:&emsp;&emsp;&emsp;${doc.quoteId}<br><br>Account:&emsp;&emsp;&emsp;&emsp;${doc.quoteContainedBy.objectName}<br><br>This email was auto-generated. Please do not reply.<br><br>

Send email notifications through a Groovy script

Sometimes Zilliant CPQ users need to send email notifications based on a specific business case. For example, if a quote's net value exceeds a particular amount, they can send a custom email notification to the relevant manager.
By running a Groovy script, they can tailor that notification to include the quote's details, a link to access that quote, and any additional attachments.

Create a Groovy script

Create a Groovy script listing all characteristics that the notification email must have. Indicate the email recipient details and the exact attachments that the email notification should include as needed.

This script supports the common binding variables and must call the following methods:

MethodClassDescription
createMimeMessagemailSender Creates a message for this sender.
getAttachmentFiles()salesItemsTree Gets an attachment file by file name.
Example Groovy script with comments
// Import necessary classes and libraries
import java.util.Locale
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.text.NumberFormat
import com.imc.vocabulary.Schema
import com.imc.iss.groovy.salesitem.*
import com.imc.iss.groovy.configitem.*
import com.imc.datamodel.BusinessObject
import com.imc.datamodel.transferobjects.BusinessDataAttributeDTO
import com.imc.datamodel.transferobjects.BusinessObjectDTO
import com.imc.datamodel.transferobjects.BusinessRelationAttributeDTO
import com.imc.datamodel.transferobjects.LocaleDTO
import java.text.SimpleDateFormat
import com.imc.util.NullUtil
import java.util.GregorianCalendar
import com.imc.context.IMCException
import org.apache.jena.ext.com.google.common.collect.Lists
import javax.activation.DataHandler
import javax.activation.DataSource
import javax.activation.FileDataSource
import javax.mail.BodyPart
import javax.mail.Message
import javax.mail.MessagingException
import javax.mail.Multipart
import javax.mail.internet.MimeBodyPart
import javax.mail.internet.MimeMessage
import javax.mail.internet.MimeMultipart
import javax.mail.util.ByteArrayDataSource
import java.io.File
import java.nio.file.Files
import javax.activation.DataHandler
import javax.activation.DataSource
import javax.activation.FileDataSource

// Call the createMimeMessage() method to create the email
def message = mailSender.createMimeMessage()

message.setSubject("Groovy Test")

// Specify the email recipient
message.addRecipient(javax.mail.Message.RecipientType.TO, new javax.mail.internet.InternetAddress("xyz@abc.com"))
message.addRecipient(javax.mail.Message.RecipientType.CC, new javax.mail.internet.InternetAddress("xyz@abc.com"))

// List attachment characteristics
def attachmentFilesSize = salesItemsTree.getAttachmentFiles().size()
def tempFiles = [] 

def tempFile = null

if (attachmentFilesSize == 0) {
    message.setText("Hello,\n\nThis is the Testing mail of Groovy Script.")
} else {

    def multipart = new MimeMultipart()

    def messageBodyPart = new MimeBodyPart()	
	String emailText = "<html><body><h1>Hello</h1><p>This is a test email.</p></body></html>"
    messageBodyPart.setText(emailText, "utf-8", "html");

    multipart.addBodyPart(messageBodyPart)
    attachmentBodyPart = new MimeBodyPart()
    def attachmentFiles = salesItemsTree.getAttachmentFiles()

    attachmentFiles.each { attachment ->
        tempFile = File.createTempFile("attachment", ".txt")
        Files.write(tempFile.toPath(), attachment.getFileContent())

        tempFiles << tempFile

        def attachmentBodyPart = new MimeBodyPart()
        def source = new FileDataSource(tempFile)
        attachmentBodyPart.setDataHandler(new DataHandler(source))
        attachmentBodyPart.setFileName(attachment.getFileName())

        multipart.addBodyPart(attachmentBodyPart)
    }

    message.setContent(multipart)
	

}
	
mailSender.send(message)

tempFiles.each { file ->
    if (file.exists()) {
        file.delete()
    }
}

// Call the notifyInfo method to send the email
groovyLogger.notifyInfo("Mail sent successfully")

return true;

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.