secret_santa_picker 0.1.0 → 0.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1166abb2c1e41a0ac85405871c4617504fe3fe18a45be7625a1eac1c0cfe808
|
4
|
+
data.tar.gz: bb4bfa1639d118f138d478ebd87a434cea8169e8dfdef2c8a238ef8e6b4658af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 683484fe29f24977fb2991f90eefa3cb610649d1d49ce22dac54df64e7fd952e52580ac000ee029eb050a345e104af162da6479b809a813adb8327e253a4665c
|
7
|
+
data.tar.gz: c0af7ab08faf4db846cacc342baf5fefa8353875cdde6da8fe04c1a3737d60e10d21734814896af7a933f3a8a1d4312fce45ed114968ab9b8cf8af408135e6b6
|
@@ -50,6 +50,10 @@ module SecretSantaPicker
|
|
50
50
|
exit 0
|
51
51
|
end
|
52
52
|
|
53
|
+
o.on "-x", "--subject-prefix", "Prepend to the Subject line a little additional message" do |arg|
|
54
|
+
config.subject_prefix = arg
|
55
|
+
end
|
56
|
+
|
53
57
|
o.banner = "secret_santa_picker <options>"
|
54
58
|
|
55
59
|
o.on_tail "-h", "--help", "Show help" do
|
@@ -6,13 +6,14 @@ module SecretSantaPicker
|
|
6
6
|
class Configuration
|
7
7
|
include ConfigDefault
|
8
8
|
|
9
|
-
attr_accessor :csv_file_path, :sender_email, :sender_password, :debug
|
9
|
+
attr_accessor :csv_file_path, :sender_email, :sender_password, :debug, :subject_prefix
|
10
10
|
|
11
11
|
def initialize(&block)
|
12
12
|
@csv_file_path = DefaultCSVFilePath
|
13
13
|
@sender_email = ENV['SENDER_EMAIL']
|
14
14
|
@sender_password = ENV['SENDER_PASSWORD']
|
15
15
|
@debug = false
|
16
|
+
@subject_prefix = nil
|
16
17
|
|
17
18
|
configure(&block) if block
|
18
19
|
end
|
@@ -18,10 +18,12 @@ module SecretSantaPicker
|
|
18
18
|
|
19
19
|
def send_mail(pair:)
|
20
20
|
sender_email = @conf.sender_email
|
21
|
+
|
22
|
+
subject = [@conf.subject_prefix, "Secret Santa #{Date.today.strftime('%Y')}"].compact.join(" ")
|
21
23
|
mail = Mail.new do
|
22
24
|
from sender_email
|
23
25
|
to pair.from.email
|
24
|
-
subject
|
26
|
+
subject subject
|
25
27
|
body "Hey #{pair.from.name},\n\nYou are the secret Santa for #{pair.to.name}.\n\nGood Luck!"
|
26
28
|
end
|
27
29
|
|