embulk-output-send_email 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/build.gradle +1 -1
- data/classpath/embulk-output-send_email-0.1.2.jar +0 -0
- data/example/config.yml +4 -7
- data/src/main/java/org/embulk/output/send_email/SendEmailOutputPlugin.java +15 -5
- metadata +2 -3
- data/classpath/embulk-output-send_email-0.1.1.jar +0 -0
- data/embulk-output-send_email-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d743b7a2618d438df8a6540d7f5ad92fb7005a9754f7b45a326bf2016b277f7
|
4
|
+
data.tar.gz: 5598dbcd74d2308226b532f858eda91d36f835c4d41fe15575300a122431934f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceca7db99426add847bf14ec4c44e04c8ee598ce314ed42d2177f2d241e3af2e0215bbb5eee3639307607d9a88176d4189ff42b796590146843a82ae55ac709b
|
7
|
+
data.tar.gz: 94e8863a4d8ac4fa4139db6035b9381aba8b0d2447b538ab8f6c04dbab2aa3e9e62d5f9d2035b7e2388930b9b2e5f8e91d85459529007e9bcfc47e999f973453
|
data/build.gradle
CHANGED
Binary file
|
data/example/config.yml
CHANGED
@@ -3,7 +3,7 @@ exec:
|
|
3
3
|
min_output_tasks: 4
|
4
4
|
in:
|
5
5
|
type: file
|
6
|
-
path_prefix:
|
6
|
+
path_prefix: C:\Users\Abhishek Gupta\Desktop\github\embulk-output-send_email\calendar.csv
|
7
7
|
parser:
|
8
8
|
type: csv
|
9
9
|
columns:
|
@@ -25,13 +25,10 @@ out:
|
|
25
25
|
to:
|
26
26
|
- ankit.kumar@infoobjects.com
|
27
27
|
- abhishek.gupta@infoobjects.com
|
28
|
-
|
29
|
-
|
30
|
-
- ankit.navral@infoobjects.com
|
31
|
-
from: ankit.navral@infoobjects.com
|
32
|
-
# password: 12334
|
28
|
+
from: abhishek.gupta@infoobjects.com
|
29
|
+
password: 11234
|
33
30
|
port: 587
|
34
|
-
username:
|
31
|
+
username: abhishek.gupta@infoobjects.com
|
35
32
|
host: smtp.gmail.com
|
36
33
|
subject: XYZ123
|
37
34
|
# row: 3
|
@@ -12,6 +12,9 @@ import javax.mail.internet.InternetAddress;
|
|
12
12
|
import javax.mail.internet.MimeBodyPart;
|
13
13
|
import javax.mail.internet.MimeMessage;
|
14
14
|
import javax.mail.internet.MimeMultipart;
|
15
|
+
import javax.validation.constraints.Null;
|
16
|
+
|
17
|
+
import static ch.qos.logback.core.joran.action.ActionConst.NULL;
|
15
18
|
|
16
19
|
public class SendEmailOutputPlugin
|
17
20
|
implements OutputPlugin {
|
@@ -27,13 +30,14 @@ public class SendEmailOutputPlugin
|
|
27
30
|
|
28
31
|
|
29
32
|
@Config("cc")
|
33
|
+
@ConfigDefault("[]")
|
30
34
|
public List<String> getCC();
|
31
35
|
|
32
36
|
@Config("from")
|
33
37
|
public String getFrom();
|
34
38
|
|
35
39
|
@Config("password")
|
36
|
-
@ConfigDefault("\"
|
40
|
+
@ConfigDefault("\"password\"")
|
37
41
|
public String getPassword();
|
38
42
|
|
39
43
|
@Config("port")
|
@@ -50,7 +54,7 @@ public class SendEmailOutputPlugin
|
|
50
54
|
public String getHost();
|
51
55
|
|
52
56
|
@Config("protocol")
|
53
|
-
@ConfigDefault("TLSv1.2")
|
57
|
+
@ConfigDefault("\"TLSv1.2\"")
|
54
58
|
public String getProtocol();
|
55
59
|
|
56
60
|
@Config("row")
|
@@ -200,6 +204,7 @@ public class SendEmailOutputPlugin
|
|
200
204
|
Properties properties = new Properties();
|
201
205
|
properties.put("mail.smtp.auth", task.getAuth());
|
202
206
|
properties.put("mail.smtp.starttls.enable", task.getSmtpEnable());
|
207
|
+
|
203
208
|
properties.put("mail.smtp.ssl.protocols", task.getProtocol());
|
204
209
|
properties.put("mail.smtp.host", task.getHost());
|
205
210
|
properties.put("mail.smtp.port", task.getPort());
|
@@ -223,13 +228,18 @@ public class SendEmailOutputPlugin
|
|
223
228
|
|
224
229
|
private static Message prepareMessage(Session session, String from, List<String> to, List<String> cc, ArrayList<LinkedHashMap<String, Object>> mapList, Schema schema, PluginTask task) {
|
225
230
|
try {
|
231
|
+
String listStringCC=null;
|
226
232
|
String listStringTo = to.stream().map(Object::toString)
|
227
233
|
.collect(Collectors.joining(","));
|
228
|
-
|
229
|
-
|
234
|
+
if(!(cc.size() ==0)) {
|
235
|
+
listStringCC = cc.stream().map(Object::toString)
|
236
|
+
.collect(Collectors.joining(","));
|
237
|
+
}
|
230
238
|
Message message = new MimeMessage(session);
|
231
239
|
message.setFrom(new InternetAddress(from));
|
232
|
-
|
240
|
+
if(listStringCC!=null) {
|
241
|
+
message.addRecipients(Message.RecipientType.CC, InternetAddress.parse(listStringCC));
|
242
|
+
}
|
233
243
|
message.addRecipients(Message.RecipientType.TO, InternetAddress.parse(listStringTo));
|
234
244
|
message.setSubject(task.getSubject());
|
235
245
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-send_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infoobjects Inc.
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- classpath/activation-1.1.jar
|
54
54
|
- classpath/commons-codec-1.10.jar
|
55
55
|
- classpath/commons-logging-1.2.jar
|
56
|
-
- classpath/embulk-output-send_email-0.1.
|
56
|
+
- classpath/embulk-output-send_email-0.1.2.jar
|
57
57
|
- classpath/google-api-client-1.26.0.jar
|
58
58
|
- classpath/google-api-client-java6-1.26.0.jar
|
59
59
|
- classpath/google-api-services-gmail-v1-rev83-1.23.0.jar
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- classpath/mail-1.4.7.jar
|
71
71
|
- config/checkstyle/checkstyle.xml
|
72
72
|
- config/checkstyle/default.xml
|
73
|
-
- embulk-output-send_email-0.1.0.gem
|
74
73
|
- example/config.yml
|
75
74
|
- gradle/wrapper/gradle-wrapper.jar
|
76
75
|
- gradle/wrapper/gradle-wrapper.properties
|
Binary file
|
Binary file
|