lundi 17 décembre 2018

Laravel5.2: Send Queue Emails by user timezone?

I want to send emails by user timezone using Queues, I have timezone column in users table.

Currently, what I am doing is using laravel mutator to set time to UTC before saving to DB:

public function setSendOnAttribute($value){
    if( $value )
        $this->attributes['send_on'] = Carbon::parse($value, auth()->user()->timezone)->tz(config('app.timezone'));//date( 'Y-m-d H:i:s', strtotime($value));
}

above code is not working, As user can use application from anywhere in the world & email must shot by user's timezone.

Please guide me, what I doing wrong?

Thanks,

Kaleem



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire