Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response code 250 #527

Open
srakl opened this issue Oct 24, 2023 · 2 comments
Open

response code 250 #527

srakl opened this issue Oct 24, 2023 · 2 comments

Comments

@srakl
Copy link

srakl commented Oct 24, 2023

What steps will reproduce the problem?

when a user registers a new account, or uses social login, they get an error

[error][usuario] Expected response code 250 but got code "454", with message "454 Throttling failure: Daily message quota exceeded.

$_SESSION = [
    '__flash' => [
        'warning' => 1
    ]
    '_csrf-otofacts' => '8Ll4AlKy-x0wOOZObSqEKxckCw4BCTj1'
    'warning' => 'Error sending registration message to \"[email protected]\". Please try again later.'
]

this is my registration action

public function actionRegister()
    {
        if (!$this->module->enableRegistration) {
            throw new NotFoundHttpException();
        }
        /** @var RegistrationForm $form */
        $form = $this->make(RegistrationForm::class);
        /** @var FormEvent $event */
        $event = $this->make(FormEvent::class, [$form]);

        $this->make(AjaxRequestModelValidator::class, [$form])->validate();

        if ($form->load(Yii::$app->request->post()) && $form->validate()) {
            $this->trigger(FormEvent::EVENT_BEFORE_REGISTER, $event);

            /** @var User $user */

            // Create a temporay $user so we can get the attributes, then get
            // the intersection between the $form fields  and the $user fields.
            $user = $this->make(User::class, [] );
            $fields = array_intersect_key($form->attributes, $user->attributes);

             // Becomes password_hash
            $fields['password'] = $form['password'];

            $user = $this->make(User::class, [], $fields );

            $user->setScenario('register');
            $mailService = MailFactory::makeWelcomeMailerService($user);

            if ($this->make(UserRegisterService::class, [$user, $mailService])->run()) {
                if ($this->module->enableEmailConfirmation) {
                    Yii::$app->session->setFlash(
                        'success',
                        Yii::t(
                            'usuario',
                            'Your account has been created and a message with further instructions has been sent to your email. Please follow the instructions to activate your account before logging in.'
                        )
                    );
                } else {
                    Yii::$app->session->setFlash('success', Yii::t('usuario', 'Your account has been created'));
                }
                $this->trigger(FormEvent::EVENT_AFTER_REGISTER, $event);

                $args = [
                    'link' => '<strong>'.Html::a(
                        'Click Here',
                        ['/'],
                        ['class' => 'alert-link']
                    ).'</strong>'
                ];

                return $this->render(
                    '/shared/message',
                    [
                        'title' => Yii::t('usuario', 'Your account has been created. {link} to continue.', $args),
                        'module' => $this->module,
                    ]
                );
                
            }
            Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User could not be registered.'));
        }
        return $this->render('register', ['model' => $form, 'module' => $this->module]);
    }

any idea why? thank you.

@srakl
Copy link
Author

srakl commented Oct 24, 2023

I think i figured it out, its the AWS SES quota, requested for an upgrade. Hopefully it will work after they approve it.

@srakl
Copy link
Author

srakl commented Oct 24, 2023

how do i turn off social login welcome email?

i get this this in logs

[usuario] Error sending welcome message to ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant