Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29758

Is there any way that I can only run a single condition will send mail?

$
0
0

This is my code:

if( 
        $form->user_mail_address && $form->model()->user_mail_address == $form->user_mail_address &&
        $form->user_nickname && $form->model()->user_nickname == $form->user_nickname &&
        $form->user_sex && $form->model()->user_sex == $form->user_sex &&
        $form->user_area && $form->model()->user_area == $form->user_area &&
        $form->user_generation && $form->model()->user_generation == $form->user_generation && 
        $form->status == Post::STATUS_APPROVED) {
            Mail::send(new DepositMail($form->model()->id, $form->model()->user_mail_address));
            Mail::send(new DepositMail($form->model()->id));}

As here I am trying when admin only change the status will send a mail to user email. But I think it's way too long. Will it have other method that will not need to use that long method to send the mail when only admin change the user status? Thank you.


Viewing all articles
Browse latest Browse all 29758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>