I investigated a little farther and found two rows in the wp_options table with option names woocommerce_wcemails57f8cb706f72c_settings and wcemails_email_details where the values in option_value correspond to the custom email that I created. So apparently the problem is not in writing data to the database.
When I enable debugging and try to display the list of custom emails, I get the following two messages:
Warning: Invalid argument supplied for foreach() in /home/blahblah/wp-content/plugins/woo-custom-emails/admin/class-wcemails-list.php on line 113
Warning: array_slice() expects parameter 1 to be array, boolean given in /home/blahblah/wp-content/plugins/woo-custom-emails/admin/class-wcemails-list.php on line 121
Is there a problem in parsing the data in the database? Here is the option_value for the row wcemails_email_details (see l. 111 of class-wcemails-list.php):
a:1:{i:0;a:12:{s:5:”title”;s:22:”Enrollment information”;s:11:”description”;s:33:”Information about your enrollment”;s:7:”subject”;s:20:”You are now enrolled”;s:10:”recipients”;s:0:””;s:7:”heading”;s:37:”Welcome to Company”;s:11:”from_status”;a:4:{i:0;s:10:”processing”;i:1;s:7:”pending”;i:2;s:7:”on-hold”;i:3;s:6:”failed”;}s:9:”to_status”;a:4:{i:0;s:9:”completed”;i:1;s:9:”completed”;i:2;s:9:”completed”;i:3;s:9:”completed”;}s:8:”template”;s:2521:”<p>Dear {order_billing_name},</p>
<p>We thank you for your enrollment in our course on {order_date}.</p>
<p>You are now enrolled in your selected course. If you have enrolled in a paying course, your credit card or Paypal account has been charged.</p>
<p>To enter the course, go to https://company.com</p>
<p>You will have received several email messages following your enrollment. Here is a summary of those messages:<p>
- Company – New Course Enrollment<br>Confirmation of your course enrollment, with a link to the course.
- Your Company order from <date> is complete<br>A receipt for your payment
- Course enrollment information<br>This message
- This view of service management… New Training Account<br>Your user name and password for your eLearning account on the site training.3cs.ch. NB: This account is not the same as the account on the site blahblah.com
- Your account on Web site name…<br>Confirmation of the creation of your account on the site company.com, with information about changing the password. If you already had registered on this site before your order, you will not receive this message. NB: This account is not the same as the eLearning account on the site company.com
- Finally, if you opted in to our mailing list, you will receive a message confirming that registration.
<p>You received your login credentials for the course in a separate email. We strongly urge you to change your password right away. To do so:<p>
- Login to the training site using the credentials you were sent
- Click on your name or avatar in the upper right corner of the screen, to open a drop-down list
- Click on Preferences
- Click on Change password
- Follow the instructions on screen
<p>If you have any questions about your enrollment or the course itself, please address them to [email protected]</p>
<p>Good luck on the course!</p>
<p>With our best wishes,<br>
My Company Training</p>”;s:12:”order_action”;s:2:”on”;s:6:”enable”;s:2:”on”;s:13:”send_customer”;s:2:”on”;s:2:”id”;s:21:”wcemails57f8cb706f72c”;}}
Thanks in advance for your help is solving this problem