easy_smtp 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/easy_smtp/smtp.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360d0f68b19505c57d8499655f5ee4e4b76ba339117d57cf960cf9b58f2d2c0f
|
4
|
+
data.tar.gz: 75b997f58bcc6e75d698799a2f10a98dfe2db67222b85aec9e7563b599a3d602
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 759c6e53b5e78f1c3b799e3f88e74f2cdd433dae4b205834acadc6ff7cdd1cefa965b2503b9f6d85f34bc1285020c8ecf3ba8ae26045003cdab74ed75cce4d20
|
7
|
+
data.tar.gz: b52c60f86a3afeed131461e2757fd22f8b532cbf6dd8d3eabf4a82b240de5bf1840b545646b706a59aa1c2098fd7c853d8840929a3ea9136f9dd4b9ce3a1709e
|
data/lib/easy_smtp/smtp.rb
CHANGED
@@ -9,12 +9,14 @@ module EasySMTP
|
|
9
9
|
# from_address: 'fromaddress@mydomain.com',
|
10
10
|
# subject: 'Subject of this email',
|
11
11
|
# body: 'Content of the email!',
|
12
|
-
# html_body: '<html><head></head><body>Content of the email in HTML format!</body></html>',
|
12
|
+
# html_body: '<html><head></head><body>Content of the email in HTML format!</body></html>', # (optional)
|
13
13
|
# attachments: ['Array of paths to files']
|
14
|
+
# server: smtp.somedomain.com, # (optionally override config)
|
15
|
+
# port: 25, # (optionally override config)
|
14
16
|
# }
|
15
17
|
def send_email(email_data)
|
16
|
-
smtp_server = EasySMTP.config['smtp']['server']
|
17
|
-
smtp_port = EasySMTP.config['smtp']['port']
|
18
|
+
smtp_server = email_data['server'] || EasySMTP.config['smtp']['server']
|
19
|
+
smtp_port = email_data['port'] || EasySMTP.config['smtp']['port']
|
18
20
|
raise "SMTP server missing from config. Add the entry to the #{EasySMTP.config.path} \"smtp\": { \"server\": \"hostname_or_ip\" }" if smtp_server.nil? || smtp_server.empty?
|
19
21
|
|
20
22
|
email_data = Hashly.stringify_all_keys(email_data.dup)
|