Customer creation process $message.functionalId successfully finished.
#set($message.content = "com/sap/consulting/showcase/email/process_success.content.content.vm")
#parse( "com/sap/consulting/showcase/email/template.content.vm" )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>$message.subject</title>
</head>
<body bgcolor="#FFFFFF" style="width:100%;padding:0;border:0;margin:0">
<table width="100%" border="0" height="100%" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center" style="padding:1em">
<tr>
<td height="100%" valign="top">
<font style="font-family:Arial; color:#666766; font-size:12px; line-height:14px">
#parse( $message.content )
</font>
</td>
</tr>
<tr>
<td>
<a href="http://www.sap.com" target="_blank"><img src='cid:$cid["logo"]' width="74" height="42" border="0" alt=""/></a>
<br>
<font style="font-family:Arial; color:#666766; font-size:10px; line-height:12px">
<strong>$legal.company</strong><br>
$legal.address <br>
$legal.registration <br>
Chairman of the Supervisory Board: $legal.chairman <br>
$legal.directors <br>
<a href="$legal.website" target="_blank">$legal.website</a>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<h1>Success</h1>
<p>Customer creation process process $message.functionalId was finished successfully.</p>
<p>Data saved for the customer:</p>
<table>
<tr>
<td><strong>Name:</strong></td>
<td>$customer.KNA1_NAME1</td>
</tr>
<tr>
<td><strong>Street:</strong><td>
<td>$customer.KNA1_STRAS</td>
</tr>
</table>
public class ShowcaseEmailServiceCallback extends BaseEmailServiceCallback {
public ShowcaseEmailServiceCallback(ClassLoader classLoader) {
super(classLoader);
}
@Override
public boolean handleAttachments(ImageHtmlEmail email, EmailAddressInformation receiver, EmailServiceContext ctx) throws Exception {
// Adding an embedded image
URL url = this.getClassLoader().getResource("com/sap/consulting/showcase/email/sap_logo.png");
String cid = email.embed(url, "SAP Logo");
ctx.getCid().put("logo", cid);
// continue 🙂
return true;
}
@Override
protected Context createTemplateContext(EmailAddressInformation receiver, EmailServiceContext ctx) {
final Context c = super.createTemplateContext(receiver, ctx);
final ABPMProcess process = ctx.getProcess();
final Message msg = new Message();
msg.setSubject("Demo Email");
msg.setContent("Demo Content...");
msg.setFunctionalId(process.getFullFunctionIdSearch());
c.put("message", msg);
final Customer customer = new Customer(process.getBo());
c.put("customer", customer);
final LegalInfo li = new LegalInfo();
li.setCompany("SAP Deutschland SE & Co. KG");
li.setAddress("Sitz der Gesellschaft/Registered Office: Walldorf, Germany");
li.setRegistration("Registergericht/Commercial Register Mannheim HRA 350654; Persönlich haftende Gesellschafterin/General Partner: SAP SE, Sitz der Gesellschaft/Registered Office: Walldorf, Germany");
li.setChairman("Geschäftsführer/MD: Dr. Daniel Holz, Hartmut Thomsen, Dr. Carl-Christian von Weyhe");
li.setDirectors("Vorstand/Executive Board: Bill McDermott (CEO), Robert Enslin, Michael Kleinemeier, Bernd Leukert, Luka Mucic, Stefan Ries und Steve Singh");
li.setWebsite("www.sap.com");
c.put("legal", li);
return c;
}
public static class Message {
private String subject;
private String content;
private String functionalId;
public String getSubject() { return subject; }
public void setSubject(String subject) { this.subject = subject; }
public String getContent() { return content; }
public void setContent(String content) { this.content = content; }
public String getFunctionalId() { return functionalId; }
public void setFunctionalId(String functionalId) { this.functionalId = functionalId; }
}
public static class LegalInfo {
private String company;
private String address;
private String registration;
private String chairman;
private String directors;
private String website;
public String getCompany() { return company; }
public void setCompany(String company) { this.company = company; }
public String getAddress() { return address; }
public void setAddress(String address) { this.address = address; }
public String getRegistration() { return registration; }
public void setRegistration(String registration) { this.registration = registration; }
public String getChairman() { return chairman; }
public void setChairman(String chairman) { this.chairman = chairman; }
public String getDirectors() { return directors; }
public void setDirectors(String directors) { this.directors = directors; }
public String getWebsite() { return website; }
public void setWebsite(String website) { this.website = website; }
}
}
@Override
public Object queryInterface(AbstractWrappedCallbackContext<Customer> ctx, InterfaceType type) {
if (InterfaceType.IEmailServiceCallback == type) {
return new ShowcaseEmailServiceCallback(this.getClass().getClassLoader());
}
return super.queryInterface(ctx, type);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
10 | |
10 | |
7 | |
7 | |
7 | |
7 |