Custom e-mail sending
-
Hello I have a problem with the registration form sending emails.
I would like it to send custom emails and for that ive created a plugin that should do that
Here is the code I used to create a template
<?php /** * Plugin Name: Custom Forminator Activation * Description: Automatically logs in and redirects users after they activate their accounts via Forminator registration form and sends a custom HTML email for activation. * Version: 1.0 * Author: Luka? * License: GPLv2 or later * Text Domain: custom-forminator-activation */ // The custom email template HTML function custom_registration_email_template( $activation_link ) { $message = ' <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Aktivacija ra?una</title> <style> body { margin: 0; padding: 0; font-family: Tahoma, Geneva, Verdana, sans-serif; } .email-background { background-color: #454a58; width: 100%; padding: 50px 0; } .logo { text-align: center; margin: 30px auto 20px; max-width: 200px; } .container { background-color: #212529; color: #fff; margin: 0 auto; padding: 20px; text-align: center; max-width: 600px; border-radius: 10px; } h1 { font-size: 24px; margin-bottom: 20px; } p { font-size: 18px; line-height: 1.5; margin-bottom: 20px; } button { background-color: #fff; color: #212529; border-radius: 33px; padding: 15px 30px; font-size: 18px; font-weight: bold; border: none; cursor: pointer; transition: all 0.3s ease-in-out; font-family: Tahoma, Geneva, Verdana, sans-serif; } button:hover { transform: scale(1.1); background-color: #454a58; color: #fff; } button:focus { outline: none; } </style> </head> <body> <div class="email-background"> <div class="logo"> <img src="https://igle.hr/wp-content/uploads/2023/03/logo_small.png" alt="Logo"> </div> <div class="container"> <h1>Aktivacija ra?una</h1> <p>Za aktivaciju korisni?kog ra?una kliknite na gumb:</p> <button><a href="' . $activation_link . '" style="text-decoration: none; color: inherit;">Aktiviraj</a></button> <p>Nakon aktivacije, primit ?ete e-mail o potvrdi registracije.</p> </div> </div> </body> </html> '; return $message; } // Modify the activation email content function custom_forminator_activation_email_content( $message, $activation_url ) { return custom_registration_email_template( $activation_url ); } add_filter( 'forminator_custom_registration_email_content', 'custom_forminator_activation_email_content', 10, 2 );
forminator_custom_registration_email_content
filter is not working as expectedThe page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom e-mail sending’ is closed to new replies.