Make sure translators give email addresses.
authorCarl Hetherington <cth@carlh.net>
Mon, 13 Dec 2021 00:00:56 +0000 (01:00 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 13 Dec 2021 21:45:56 +0000 (22:45 +0100)
src/tools/dcpomatic.cc

index 70abcf3b7779882335c416a428fd0e6d045549a8..a273d008b11948e56aeaba42d784c59bbf08a42e 100644 (file)
@@ -1101,8 +1101,17 @@ private:
                                body += i.first + "\n" + i.second + "\n\n";
                        }
                        list<string> to = { "carl@dcpomatic.com" };
-                       Emailer emailer (d->email(), to, "DCP-o-matic translations", body);
-                       emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
+                       if (d->email().find("@") == string::npos) {
+                               error_dialog (this, _("You must enter a valid email address when sending translations, "
+                                                     "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions."));
+                       } else {
+                               Emailer emailer (d->email(), to, "DCP-o-matic translations", body);
+                               try {
+                                       emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS);
+                               } catch (NetworkError& e) {
+                                       error_dialog (this, _("Could not send translations"), std_to_wx(e.what()));
+                               }
+                       }
                }
 
                d->Destroy ();