Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Verification Email Cannot send.

    General Discussion
    3
    11
    1755
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rahul last edited by

      Hi @valpuia

      If you are using the config:cache command during deployment, you must make sure that you are only calling the env function from within your configuration files, and not from anywhere else in your application.

      But for a quick fix this will do:

      php artisan config:clear
      

      But i used your mail configuration in my application, then given errors occur - https://prnt.sc/pxanad

      Kindly check your configuration from mailtrap and you can use it.

      Thanks

      1 Reply Last reply Reply Quote 0
      • V
        valpuia last edited by

        @rahul You got error because I regenerate mailtrap credentials, however I did php artisan config:clear and php artisan config:cache but still cannot send email like below image
        email.png

        1 Reply Last reply Reply Quote 0
        • R
          rahul last edited by

          Hi @valpuia

          Only run - php artisan config:clear

          Then check.

          1 Reply Last reply Reply Quote 0
          • V
            valpuia last edited by

            @rahul I run php artisan config:clear only but still got the same issue.

            1 Reply Last reply Reply Quote 0
            • R
              rahul last edited by

              Hi @valpuia

              Once clear the browser cache, then run above command then check.

              Thanks

              1 Reply Last reply Reply Quote 0
              • V
                valpuia last edited by

                @rahul
                When I click resend email verification then I got like below image
                email_resend.png

                1 Reply Last reply Reply Quote 0
                • V
                  valpuia last edited by

                  @rahul
                  I clear the browser, then run config:clear but still got same issue. Any other Idea to send verification email?
                  Thanks

                  1 Reply Last reply Reply Quote 0
                  • R
                    rahul last edited by

                    Hi @valpuia

                    Open your Customer package, in this package's mail folder, you can find a file called ' VerificationEmail.php'. Replace the below code there.

                    <?php
                    
                    namespace Webkul\Customer\Mail;
                    
                    use Illuminate\Bus\Queueable;
                    use Illuminate\Mail\Mailable;
                    use Illuminate\Queue\SerializesModels;
                    use Illuminate\Contracts\Queue\ShouldQueue;
                    use Config;
                    
                    /**
                     * Verification Mail class
                     *
                     * @author    Rahul Shukla <rahulshukla.symfony517@webkul.com>
                     * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
                     */
                    class VerificationEmail extends Mailable
                    {
                        use Queueable, SerializesModels;
                    
                        public $verificationData;
                    
                        public function __construct($verificationData) {
                            $this->verificationData = $verificationData;
                        }
                    
                        /**
                         * Build the message.
                         *
                         * @return \Illuminate\View\View
                         */
                        public function build()
                        {
                            return $this->to($this->verificationData['email'])
                                ->from(Config::get('mail.from.address'))
                                ->subject(trans('shop::app.mail.customer.verification.subject'))
                                ->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]);
                        }
                    }
                    

                    Thanks

                    A 1 Reply Last reply Reply Quote 0
                    • V
                      valpuia last edited by

                      I can get email now, thanks @rahul

                      1 Reply Last reply Reply Quote 0
                      • A
                        AshJi @rahul last edited by

                        @rahul said in Verification Email Cannot send.:

                            return $this->to($this->verificationData['email'])
                                ->from(Config::get('mail.from.address'))
                                ->subject(trans('shop::app.mail.customer.verification.subject'))
                                ->view('shop::emails.customer.verification-email')->with('data', ['email' => $this->verificationData['email'], 'token' => $this->verificationData['token']]);
                        

                        @rahul I am using Bagisto v1.1.2 and facing same issue in production (works fine in dev env).

                        I checked the VerificationEmail.php and above changes u suggested are not there. Wondering whether changes u suggested are still valid to fix this issue.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post