File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 4848 exit ();
4949}
5050
51- if ($ config ['mail ' ]['send_all_later ' ]) {
51+ if ($ config ['mail ' ]['send_all_later ' ] || isset ( $ _POST [ ' addToDb ' ]) ) {
5252 $ mailService = MailService::getInstance ();
5353 // Save each recipient to the database
5454 foreach ($ recipients as $ recipient ) {
5555 $ mailService ->addRecipientToDatabase ($ recipient );
5656 }
57- echo json_encode (['success ' => true , 'saved ' => true ]);
58- exit ();
57+ if ($ config ['mail ' ]['send_all_later ' ]) {
58+ echo json_encode (['success ' => true , 'saved ' => true ]);
59+ exit ();
60+ }
5961}
6062
6163if (empty ($ _POST ['image ' ])) {
Original file line number Diff line number Diff line change @@ -1072,6 +1072,26 @@ const photoBooth = (function () {
10721072 virtualKeyboard . initialize ( config . mail . keyboardLayout , '#send-mail-recipient' , '#send-mail-form' ) ;
10731073 }
10741074
1075+ // add to database on send
1076+ if ( ! config . mail . send_all_later ) {
1077+ const dbCheckboxWrapper = document . createElement ( 'div' ) ;
1078+ dbCheckboxWrapper . classList . add ( 'form-db-checkbox-wrapper' ) ;
1079+
1080+ const dbCheckbox = document . createElement ( 'input' ) ;
1081+ dbCheckbox . type = 'checkbox' ;
1082+ dbCheckbox . id = 'send-mail-db-checkbox' ;
1083+ dbCheckbox . name = 'addToDb' ;
1084+ dbCheckbox . classList . add ( 'form-db-checkbox' ) ;
1085+
1086+ const dbCheckboxLabel = document . createElement ( 'label' ) ;
1087+ dbCheckboxLabel . htmlFor = 'send-mail-db-checkbox' ;
1088+ dbCheckboxLabel . textContent = ' ' + photoboothTools . getTranslation ( 'add_to_mail_database' ) ;
1089+
1090+ dbCheckboxWrapper . appendChild ( dbCheckbox ) ;
1091+ dbCheckboxWrapper . appendChild ( dbCheckboxLabel ) ;
1092+ form . appendChild ( dbCheckboxWrapper ) ;
1093+ }
1094+
10751095 // Submit
10761096 const submitLabel = config . mail . send_all_later
10771097 ? photoboothTools . getTranslation ( 'add' )
Original file line number Diff line number Diff line change 22 "abort" : " Abort" ,
33 "add" : " Add" ,
44 "add_image" : " Add image" ,
5+ "add_to_mail_database" : " save email address(es)" ,
56 "admin_panel" : " Admin panel" ,
67 "adminpanel_back" : " Back" ,
78 "adminpanel_toggletextOFF" : " Off" ,
You can’t perform that action at this time.
0 commit comments