7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/inkcite/cli/preview.rb', line 7
def self.invoke email, to, opt
email.upload unless opt[:'no-upload']
also = opt[:also]
unless also.blank?
if also.any? { |a| a.match(',') }
also = also.collect { |a| a.split(',') }.flatten
opt = opt.dup
opt[:also] = also
end
end
case to.to_sym
when :client
Inkcite::Mailer.client(email, opt)
when :internal
Inkcite::Mailer.internal(email, opt)
when :developer
Inkcite::Mailer.developer(email, opt)
else
abort <<-USAGE.strip_heredoc
Oops! Inkcite doesn't recognize that distribution list. It needs
to be one of 'client', 'internal' or 'developer':
inkcite preview internal
USAGE
end
end
|