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

[SES] Custom verification email template no redirect #2905

Closed
apuntovanini opened this issue Aug 29, 2023 · 9 comments
Closed

[SES] Custom verification email template no redirect #2905

apuntovanini opened this issue Aug 29, 2023 · 9 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@apuntovanini
Copy link

Describe the bug

I use the client.create_custom_verification_email_template with a success_redirection_url params, but it seems ineffective, I alwasy get redirected to https://aws.amazon.com/it/ses/details/

Expected Behavior

I should get redirected to the url I pass to the

success_redirection_url: 'https://me.uidu.org/ses/confirmed',
failure_redirection_url: 'https://me.uidu.org/ses/failed',

Current Behavior

I use the client.create_custom_verification_email_template with a success_redirection_url params, but it seems ineffective, I alwasy get redirected to https://aws.amazon.com/it/ses/details/

Reproduction Steps

require 'aws-sdk-ses'

client.create_custom_verification_email_template({
            template_name:,
            from_email_address: '[email protected]',
            template_subject: 'Email Address Verification Request',
            template_content: "<html><body><h3>Inizia ad inviare email da #{recipient}</h3><div>Dear partner for #{context[:current_workspace].name},</div><br><div></div></body></html>",
            success_redirection_url: 'https://me.uidu.org/ses/confirmed',
            failure_redirection_url: 'https://me.uidu.org/ses/failed',
          })

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

[email protected]

Environment details (Version of Ruby, OS environment)

ruby 3.2.2

@apuntovanini apuntovanini added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 29, 2023
@mullermp mullermp added investigating Issue is being investigated and removed bug This issue is a bug. labels Aug 29, 2023
@yenfryherrerafeliz yenfryherrerafeliz self-assigned this Aug 29, 2023
@yenfryherrerafeliz
Copy link

Hi @apuntovanini, thanks for opening this issue. In order to use custom verification templates the AWS SES account needs to be out of the AWS sandbox, which can be confirmed in the documentation here. Could you please confirm that your SES account is out of the sandbox?, and if so, are you using the send-custom-verification-email request where you should be specifying the custom template?

Please let me know.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating Issue is being investigated needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2023
@apuntovanini
Copy link
Author

Hi @yenfryherrerafeliz, thanks for the quick reply. I confirm the account is out of the sandbox and that we're using the API as of documentation:

template_name = SecureRandom.hex(10)

          client.create_custom_verification_email_template({
            template_name:,
            from_email_address: '[email protected]',
            template_subject: 'Email Address Verification Request',
            template_content: "<html><body><h3>Inizia ad inviare email da #{recipient}</h3><div>Dear partner for #{context[:current_workspace].name},</div><br><div></div></body></html>",
            success_redirection_url: 'https://me.uidu.org/ses/confirmed',
            failure_redirection_url: 'https://me.uidu.org/ses/failed',
          })

          response = client.send_custom_verification_email({
            email_address: recipient,
            template_name:
          })

@yenfryherrerafeliz yenfryherrerafeliz added the investigating Issue is being investigated label Aug 30, 2023
@yenfryherrerafeliz
Copy link

@apuntovanini, thanks for letting me know. I will get back to you with some updates soon.

Thanks!

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Aug 31, 2023
@yenfryherrerafeliz
Copy link

Opened internal ticket: V1024158693

@yenfryherrerafeliz
Copy link

Hi @apuntovanini, I reached to the service team regarding this issue, but when they tried to reproduce it they did not have any issues. Would it be possible for you to try with the following code below?, which will also create a new template:

# Create template:
require 'aws-sdk-ses'
ses = Aws::SES::Client.new(
  region: 'us-east-1'
)

begin
  response = ses.create_custom_verification_email_template({
            template_name:'ruby',
            from_email_address: '[email protected]',
            template_subject: 'Email Address Verification Request',
            template_content: "manoj",
            success_redirection_url: 'https://me.uidu.org/ses/confirmed',
            failure_redirection_url: 'https://me.uidu.org/ses/failed',
          })
          puts "Success"
rescue Aws::SES::Errors::ServiceException => e
    puts "Error"    
end

Sending custom verification email:
==========================
require 'aws-sdk-ses'

ses = Aws::SES::Client.new(
    region: 'us-east-1'
  )

begin
  response =  ses.send_custom_verification_email({
    email_address: "[[email protected]](mailto:[email protected])", # required
    template_name: "ruby", # required
  })
  puts "Sucess"
rescue Aws::SES::Errors::ServiceException => e
    puts "Error"    
end

Please let me know the results.

Thanks!

@yenfryherrerafeliz yenfryherrerafeliz added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating Issue is being investigated labels Sep 2, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 8, 2023
@apuntovanini
Copy link
Author

Ok, now it seems to work, changed nothing...
May this be because I delete the very same template name right after sending it?

template_name = SecureRandom.hex(10)

response = client.send_custom_verification_email({
            email_address: recipient,
            template_name:
          })

          puts response.inspect

          client.delete_custom_verification_email_template({
            template_name:
          })

In this case, I should probably keep track of template names I use, and then remove them (I need to customize them for each activation)
Thanks!

@apuntovanini
Copy link
Author

Yep, seems exactly the case! Ok, I'll rework my implementation using a custom link to confirm the address and after that remove the custom template, thanks for your support!

@mullermp mullermp closed this as completed Sep 9, 2023
@github-actions
Copy link

github-actions bot commented Sep 9, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants