Changes for page Send emails

Last modified by Erik Bakker on 2024/09/03 08:52

From version 16.1
edited by eMagiz
on 2022/05/05 16:17
Change comment: There is no comment for this version
To version 17.1
edited by Erik Bakker
on 2022/06/10 08:38
Change comment: Imported from XAR

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.marijn
1 +XWiki.ebakker
Content
... ... @@ -1,16 +1,9 @@
1 -{{html wiki="true"}}
2 -<div class="ez-academy">
3 - <div class="ez-academy_body">
4 -
5 -<div class="doc">
6 -
7 -
8 -
1 +{{container}}{{container layoutStyle="columns"}}(((
9 9  = Send emails =
10 10  
11 11  We explained the MIME protocol in the previous [microlearning](advanced-mail-connectivity-whatis-mime.md). In this microlearning, we will expand our knowledge by learning how to send emails with the help of MIME messages via the eMagiz platform.
12 12  
13 -Should you have any questions, please get in touch with academy@emagiz.com.
6 +Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].
14 14  
15 15  * Last update: January 24th, 2022
16 16  * Required reading time: 5 minutes
... ... @@ -33,13 +33,13 @@
33 33  
34 34  eMagiz provides you with a variety of mail-related components to send mail. See below for a snapshot of the current list of components offered by eMagiz with regards to mail. To send a mail, we need at least the support object called "Java mail sender" and the outbound channel adapter called "Mail outbound channel adapter" from the list below.
35 35  
36 -<p align="center">[[image:advanced-mail-connectivity-using-mime-mail-components.png||]]</p>
29 +[[image:Main.Images.Microlearning.WebHome@advanced-mail-connectivity-using-mime-mail-components.png]]
37 37  
38 38  === 3.1 Setting up the MIME message ===
39 39  
40 40  However, before sending a mail with the help of these components, we first need to make sure that the payload of our message is not just a string in JSON or XML form but is a message of the MIME type. For example, you can use a standard component in eMagiz called "XML to MIME message transformer" to achieve this. Note that when transforming your XML to MIME, eMagiz expects a specific structure. For example, the XSD belonging to this structure can be found in the Store under the Store item called: "Send Mail * Java."
41 41  
42 -<p align="center">[[image:advanced-mail-connectivity-using-mime-mime-components.png||]]</p>
35 +[[image:Main.Images.Microlearning.WebHome@advanced-mail-connectivity-using-mime-mime-components.png]]
43 43  
44 44  So to transform our XML to MIME, we should prepare our XML with the help of the transformation tooling (i.e., message mapping) that eMagiz offers. In the case of messaging, you can define your system message to be equal to the structure as described in the Store item by importing the item from the Store. The same logic applies to the API Management and Event Streaming pattern in eMagiz.
45 45  
... ... @@ -47,7 +47,7 @@
47 47  
48 48  Once you have defined the XML structure and have created the proper transformation, the next step would be to validate the message and afterward transform the XML to a MIME message. An example of how this can be implemented can be found below.
49 49  
50 -<p align="center">[[image:advanced-mail-connectivity-using-mime-transform-xml-to-mime.png||]]</p>
43 +[[image:Main.Images.Microlearning.WebHome@advanced-mail-connectivity-using-mime-transform-xml-to-mime.png]]
51 51  
52 52  Note that before you can correctly configure your "XML to MIME transformer," you first need to define your "Java mail sender" support object. In here, you need to fill in, at the minimum, a reference to the host and the port of the mail server to whom you want to connect. When setting up the connection, we will focus on this component in more detail.
53 53  
... ... @@ -55,16 +55,16 @@
55 55  
56 56  We need to define a mail outbound channel adapter and link it to the Java mail sender to send the email. We also need to consider specific configurations for our Java mail sender, such as providing a username/password combination because the mail server expects an authenticated request. To define the username and password, open the Java mail sender component, navigate to the Advanced tab, define the username and password with the help of properties and define a Java mail property as specified in the help text. The result should look something as follows.
57 57  
58 -<p align="center">[[image:advanced-mail-connectivity-using-mime-java-mail-sender-config.png||]]</p>
51 +[[image:Main.Images.Microlearning.WebHome@advanced-mail-connectivity-using-mime-java-mail-sender-config.png]]
59 59  
60 60  Note that there are many more java mail properties that could be defined. Which properties to define largely depends on the mail server you are setting up a connection with. An overview of some other java mail properties can be found [here](https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html).
61 61  
62 62  Now that we have configured the Java mail sender, it is time to link the components together. To do so, please open the mail outbound channel adapter and select the correct mail sender from the dropdown list.
63 63  
64 -<p align="center">[[image:advanced-mail-connectivity-using-mime-mail-outbound-config.png||]]</p>
57 +[[image:Main.Images.Microlearning.WebHome@advanced-mail-connectivity-using-mime-mail-outbound-config.png]]
65 65  
66 -===== Practice =====
67 67  
60 +
68 68  == 4. Assignment ==
69 69  
70 70  Build a flow that can send emails. This assignment can be completed with the help of the (Academy) project that you have created/used in the previous assignment.
... ... @@ -89,11 +89,4 @@
89 89  
90 90  This video demonstrates a working solution and how you can validate whether you have completed the assignment.
91 91  
92 -<iframe width="1280" height="720" src="../../vid/microlearning/advanced-mail-connectivity-using-mime.mp4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
93 -
94 -</div>
95 -</main>
96 -</div>
97 -</div>
98 -
99 -{{/html}}
85 +{{video attachment="advanced-mail-connectivity-using-mime.mp4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>)))((({{toc/}}))){{/container}}{{/container}}