diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-09-17 23:36:26 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-09-17 23:36:26 +0200 |
| commit | 67fa57cc3b626fd111582f4954fd848981c792d9 (patch) | |
| tree | 30eb6dc44c47b3822b82fbf0f4f46322e7e65367 /src/lib/kdm_with_metadata.cc | |
| parent | f1b2884943ab6fd1e3ba37b017d41b65645f49dc (diff) | |
When emailing multiple addresses, put one in To: and the rest in CC: (#2310).
Diffstat (limited to 'src/lib/kdm_with_metadata.cc')
| -rw-r--r-- | src/lib/kdm_with_metadata.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/kdm_with_metadata.cc b/src/lib/kdm_with_metadata.cc index bebb5df86..7dee935c4 100644 --- a/src/lib/kdm_with_metadata.cc +++ b/src/lib/kdm_with_metadata.cc @@ -250,7 +250,13 @@ send_emails ( } boost::algorithm::replace_all (body, "$SCREENS", screens.substr (0, screens.length() - 2)); - Emailer email (config->kdm_from(), first->emails(), subject, body); + auto emails = first->emails(); + Emailer email (config->kdm_from(), { emails.front() }, subject, body); + + /* Use CC for the second and subsequent email addresses, so we seem less spammy (#2310) */ + for (auto cc = std::next(emails.begin()); cc != emails.end(); ++cc) { + email.add_cc(*cc); + } for (auto cc: config->kdm_cc()) { email.add_cc (cc); |
