Title: Multiple Emails for Alerts (Code Within)
Last modified: September 11, 2018

---

# Multiple Emails for Alerts (Code Within)

 *  Resolved [Dylan Nunns](https://wordpress.org/support/users/dylannunns/)
 * (@dylannunns)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/multiple-emails-for-alerts-code-within/)
 * Hey there Edir,
 * I am looking to send out Vulnerability Reports to multiple people through your
   plugin. I noticed that it is not able to handle that in its current state.
 * Right now if you try and add multiple emails, the validation method using **is_email()**
   validates as false, as _[email@test.com](https://wordpress.org/support/topic/multiple-emails-for-alerts-code-within/email@test.com?output_format=md),
   other@test.com_ will validate as an incorrect email.
 * I modified the validation method to support handling multiple email addresses.
   Is this something that could be addressed? Or is there a way I could create assist
   on the plugin and create a Pull Request for the change?
 * Here are the changes I made:
 * Modified in **vulnerability-alerts.php**
 *     ```
       /*
       * Validating fields
       */
       static public function validate($input) {
       	if ( ! empty( $input['email'] ) ) {
       		// Remove any whitespace
       		$input['email'] = preg_replace('/\s/', '', $input['email']);
   
       		// Check for multiple emails, separated by the comma (,)
       		$emails = explode( ',', $input['email'] );
   
       		// Loop through the emails and ensure they are all valid
       		foreach ( $emails as $email ) {
       			if ( ! is_email( $email ) ) {
       				add_settings_error( self::$id . '_notification', 'invalid-email', __( 'You have entered an invalid e-mail address.', self::$id ) );
       			}
       		}
   
       	}
   
       	return $input;
       }
       ```
   
 * I also added a line to the introduction explaining how to add multiple e-mails
   for notifications.
 *     ```
       /*
       * Introduction
       */
       static public function introduction() {
   
       	echo '<p>' . __('Fill the options below if you want to be notified by mail about new vulnerabilities. To add multiple e-mail addresses, separate them via comma (,).', self::$id) . '</p>';
   
       }
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [ethicalhack3r](https://wordpress.org/support/users/ethicalhack3r/)
 * (@ethicalhack3r)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/multiple-emails-for-alerts-code-within/#post-11271854)
 * This fix looks to have been implemented in the vulnerability-alerts plugin. This
   fix has been carried over to the new plugin available at [https://wordpress.org/plugins/wpscan/](https://wordpress.org/plugins/wpscan/)

Viewing 1 replies (of 1 total)

The topic ‘Multiple Emails for Alerts (Code Within)’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/vulnerability-alerts_3a474e.svg)
 * [Vulnerability Alerts](https://wordpress.org/plugins/vulnerability-alerts/)
 * [Support Threads](https://wordpress.org/support/plugin/vulnerability-alerts/)
 * [Active Topics](https://wordpress.org/support/plugin/vulnerability-alerts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/vulnerability-alerts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/vulnerability-alerts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ethicalhack3r](https://wordpress.org/support/users/ethicalhack3r/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/multiple-emails-for-alerts-code-within/#post-11271854)
 * Status: resolved