if (!boost::filesystem::exists (path) || confirm_overwrite (path)) {
boost::filesystem::create_directories (path);
write_files(kdm, path, filename_format, confirm_overwrite);
+ written += kdm.size();
}
- written += kdm.size();
}
return written;
throw NetworkError (_("No mail server configured in preferences"));
}
+ if (config->kdm_from().empty()) {
+ throw NetworkError(_("No KDM from address configured in preferences"));
+ }
+
for (auto const& kdms_for_cinema: kdms) {
auto first = kdms_for_cinema.front();
}
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);