File tree 1 file changed +15
-8
lines changed
1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -47,22 +47,29 @@ defmodule ChatApi.Workers.SendGmailNotification do
47
47
last_from
48
48
end
49
49
50
+ cc =
51
+ case Google.Gmail . extract_email_address ( gmail_cc ) do
52
+ cc when is_binary ( cc ) -> cc
53
+ _ -> [ ]
54
+ end
55
+
56
+ references =
57
+ case gmail_references do
58
+ ref when is_binary ( ref ) -> ref <> " " <> gmail_message_id
59
+ _ -> gmail_message_id
60
+ end
61
+
50
62
payload = % {
51
63
from: from ,
52
- subject: "Re: " <> gmail_initial_subject ,
64
+ subject: "Re: #{ gmail_initial_subject } " ,
53
65
text: body ,
54
66
to: to ,
67
+ cc: cc ,
55
68
in_reply_to: gmail_message_id ,
56
- references: gmail_references <> " " <> gmail_message_id ,
69
+ references: references ,
57
70
thread_id: gmail_thread_id
58
71
}
59
72
60
- payload =
61
- case Google.Gmail . extract_email_address ( gmail_cc ) do
62
- cc when is_binary ( cc ) -> Map . merge ( payload , % { cc: cc } )
63
- _ -> payload
64
- end
65
-
66
73
Logger . info ( "Sending payload to Gmail: #{ inspect ( payload ) } " )
67
74
68
75
% { "id" => gmail_message_id , "threadId" => ^ gmail_thread_id } =
You can’t perform that action at this time.
0 commit comments