Suggest to a filter
-
Hi
Great plugin. We left CF7, Grav, any many other years ago when this AF plugin arrived as we prefer ACF as engine to handle as much as we can instead of thousends API.
There are plenty of filter for the email variable, still we missing one for many years, and each time we update the plugin we have to add the filter again.
We extended the plugin with the option “Send as plain text”. In order to send some notifications in plain text, and others as default html, we must be able to filter the
html
output.It would be great if you added 4 lines as below:
// Construct email HTML $html = sprintf( '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>%s</title> <style>%s</style> </head> <body> %s </body> </html>', $subject, $style, $content ); // CHANGES START: // Filter each html - needed $html = apply_filters( 'af/form/email/html', $html, $email, $form, $fields, $subject, $style, $content); $html = apply_filters( 'af/form/email/html/id=' . $form['post_id'], $html, $email, $form, $fields, $subject, $style, $content ); $html = apply_filters( 'af/form/email/html/key=' . $form['key'], $html, $email, $form, $fields, $subject, $style, $content ); // CHANGES END
We alse extended the plugin to use Askimet to validate any email field, added “Reply-to” field, custom column information from the form on saved entries, and more.
Happy to email the whole php file, or screenshots if you wanna use some ideas.
/ Intervik Development Team
- The topic ‘Suggest to a filter’ is closed to new replies.