This is possible exactly how you said it. Add the folder in your theme and it should work.
Nobody tested this except me in the early days of the plugin. If you can give this a go and let me know.
I set about creating the following procedure to create customised email bodies (and it does work).
I could not work out how to change the email subject as it seems to be stored in some internal array.
Following is a procedure which I successfully used to make customised emails (bodies) using templates.
1. mkdir mytheme/gdpr/email
2. copy two files from plugins/gdpr/templates/emails to mytheme/gdpr/email such as:
index.php and export-data-request.php
3. Check or set permissions for directory and files to be owned by the webserver.
4. Customise the test email template, in this case export-data-request.php. If for any reason there is an error in the PHP file it should be noted that the plugin will use the built in template.
Following is an example of customised export-data-request.php
<?php
echo sprintf( esc_html__(
‘A request has been received to download your personal data from our website.
If this was not you, then we recommend that you look to change your password to our website.
To download your personal data as an XML file, click here: %s
To download your personal data as a JSON file, click here: %s
Regards
Data Privacy Officer
‘, ‘gdpr’ ),
esc_url_raw( $args[‘confirm_url_xml’] ),
esc_url_raw( $args[‘confirm_url_json’] )
);
As an additional note, I am note sure why when I add the following snipped to my functions.php the email message is being sent to and from the same address ([email protected])
if (! function_exists (‘my_gdpr_sender’)) {
function lf_gdpr_sender () { return ‘[email protected]’; }
add_filter (‘gdpr_do_not_reply_address’, ‘my_gdpr_sender’,99);
}
Subjects can be changed with filters.
Here’s the array with all the subjects and their respective filters
$possible_types = apply_filters(
'gdpr_email_types', array(
'new-request' => apply_filters( 'gdpr_new_request_email_subject', esc_html__( 'GDPR Notification: There is a new request waiting to be reviewed.', 'gdpr' ) ),
'delete-request' => apply_filters( 'gdpr_delete_request_email_subject', esc_html__( 'Someone requested to close your account.', 'gdpr' ) ),
'delete-resolved' => apply_filters( 'gdpr_delete_resolved_email_subject', esc_html__( 'Your account has been closed.', 'gdpr' ) ),
'rectify-request' => apply_filters( 'gdpr_rectify_request_email_subject', esc_html__( 'Someone requested that we rectify data of your account.', 'gdpr' ) ),
'rectify-resolved' => apply_filters( 'gdpr_rectify_resolved_email_subject', esc_html__( 'Your request has been completed.', 'gdpr' ) ),
'complaint-request' => apply_filters( 'gdpr_complaint_request_email_subject', esc_html__( 'Someone made complaint on behalf of your account.', 'gdpr' ) ),
'complaint-resolved' => apply_filters( 'gdpr_complaint_resolved_email_subject', esc_html__( 'Your request has been completed.', 'gdpr' ) ),
'export-data-request' => apply_filters( 'gdpr_export_data_request_email_subject', esc_html__( 'Someone requested to download your data.', 'gdpr' ) ),
'export-data-resolved' => apply_filters( 'gdpr_export_data_resolved_email_subject', esc_html__( 'Your request has been completed.', 'gdpr' ) ),
'data-breach-request' => apply_filters( 'gdpr_data_breach_request_email_subject', esc_html__( 'Someone requested to send a data breach notification.', 'gdpr' ) ),
'data-breach-notification' => apply_filters( 'gdpr_data_breach_resolved_email_subject', esc_html__( 'Data Breach Notification.', 'gdpr' ) ),
)
);
The way I’ve set emails up is from: noreply to: noreply and the actual targets are added as Bcc.
Thank you for testing the email templates. I’ll add that to the documentation.
Thanks for the info, this will help for me to make customised emails.
If you want I can send you my final procedure
Sure. It’s always nice to see other implementations.