diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-16 14:28:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-16 14:28:36 +0100 |
| commit | 5d06efadc0cc88c38a3ab3a44ef676f89ae2e43c (patch) | |
| tree | 26a422dd6772495d0569d3c90e1bb31d996ea014 /src/lib/kdm.cc | |
| parent | 5dc36423e504f29752599cfa3ae72433467b4644 (diff) | |
Allow $CPL_NAME etc. in KDM email subjects. Add de_DE translation of
default subject.
Suggested-by: Carsten Kurz
Diffstat (limited to 'src/lib/kdm.cc')
| -rw-r--r-- | src/lib/kdm.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/kdm.cc b/src/lib/kdm.cc index 571e09b69..49f04724a 100644 --- a/src/lib/kdm.cc +++ b/src/lib/kdm.cc @@ -232,20 +232,30 @@ email_kdms ( /* Send email */ quickmail_initialize (); - quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), Config::instance()->kdm_subject().c_str ()); + + stringstream start; + start << from.date() << " " << from.time_of_day(); + stringstream end; + end << to.date() << " " << to.time_of_day(); + + string subject = Config::instance()->kdm_subject(); + boost::algorithm::replace_all (subject, "$CPL_NAME", film->dcp_name ()); + boost::algorithm::replace_all (subject, "$START_TIME", start.str ()); + boost::algorithm::replace_all (subject, "$END_TIME", end.str ()); + boost::algorithm::replace_all (subject, "$CINEMA_NAME", i->cinema->name); + quickmail mail = quickmail_create (Config::instance()->kdm_from().c_str(), subject.c_str ()); + quickmail_add_to (mail, i->cinema->email.c_str ()); if (!Config::instance()->kdm_cc().empty ()) { quickmail_add_cc (mail, Config::instance()->kdm_cc().c_str ()); } + string body = Config::instance()->kdm_email().c_str(); boost::algorithm::replace_all (body, "$CPL_NAME", film->dcp_name ()); - stringstream start; - start << from.date() << " " << from.time_of_day(); boost::algorithm::replace_all (body, "$START_TIME", start.str ()); - stringstream end; - end << to.date() << " " << to.time_of_day(); boost::algorithm::replace_all (body, "$END_TIME", end.str ()); boost::algorithm::replace_all (body, "$CINEMA_NAME", i->cinema->name); + stringstream screens; for (list<ScreenKDM>::const_iterator j = i->screen_kdms.begin(); j != i->screen_kdms.end(); ++j) { screens << j->screen->name << ", "; |
