-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Verification link in welcome mail #3992
Verification link in welcome mail #3992
Conversation
Generated by 🚫 Danger |
If I'm right, this code will update the is_verified field even when the user has already activated an account. Can you change it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -18,6 +18,13 @@ | |||
|
|||
Looking forward to hearing from you soon, | |||
|
|||
Please click on the link below to verify your email. | |||
|
|||
<% verifaction_link="https://publiclab.org/verify/#{@user.generate_token}" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we could replace publiclab.org
with <%= ActionMailer::Base.default_url_options[:host] %>
so it's not host-specific!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I fixed that. Thank you so much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, would you be able to add a functional test for this ? Thank you!!!
Yes I ll do that asap. I am kindoff stuck with semester exams ! Will do
that in a day or two . Thank you so much !
…On Fri, Nov 30, 2018, 9:57 AM Jeffrey Warren ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Hello, would you be able to add a functional test for this ? Thank you!!!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3992 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARofxUU8FIKiF5gcv0wofIUeBEK4aAVuks5u0LO5gaJpZM4Ymj0I>
.
|
good luck with your exams!
On Fri, Nov 30, 2018 at 6:43 AM Shubham Sangamnerkar <
notifications@github.com> wrote:
… Yes I ll do that asap. I am kindoff stuck with semester exams ! Will do
that in a day or two . Thank you so much !
On Fri, Nov 30, 2018, 9:57 AM Jeffrey Warren ***@***.***>
wrote:
> ***@***.**** requested changes on this pull request.
>
> Hello, would you be able to add a functional test for this ? Thank you!!!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#3992 (review)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/ARofxUU8FIKiF5gcv0wofIUeBEK4aAVuks5u0LO5gaJpZM4Ymj0I
>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3992 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ0ogXE2uVgijALJn6zAlzvA9zYulks5u0Rm9gaJpZM4Ymj0I>
.
|
I tried writing the tests and encountered this error "undefined method |
Is it in the Travis tests or on your local? Try rerunning them, I think
there is an intermittent issue with Travis...
Hope that helps!
…On Mon, Dec 17, 2018, 4:13 AM Shubham Sangamnerkar ***@***.*** wrote:
I tried writing the tests and encountered this error "undefined method []'
for true:TrueClass from
lib/authlogic_openid/authlogic_openid/acts_as_authentic.rb:74:in save'
" on line " user_obj.update(:is_verified => true)" in users_controller.
Tried debugging it but to no avail. @jywarren
<https://github.com/jywarren> do you know why this is happening? Thanking
you in advance!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3992 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ_9JimkWW4eGCgxyGyewDkY3mIhFks5u52AdgaJpZM4Ymj0I>
.
|
Its not passing even on my local machine , would definitely fail on Travis !
On Mon, Dec 17, 2018, 9:35 PM Jeffrey Warren <notifications@github.com>
wrote:
… Is it in the Travis tests or on your local? Try rerunning them, I think
there is an intermittent issue with Travis...
Hope that helps!
On Mon, Dec 17, 2018, 4:13 AM Shubham Sangamnerkar <
***@***.***
wrote:
> I tried writing the tests and encountered this error "undefined method
[]'
> for true:TrueClass from
> lib/authlogic_openid/authlogic_openid/acts_as_authentic.rb:74:in save'
> " on line " user_obj.update(:is_verified => true)" in users_controller.
> Tried debugging it but to no avail. @jywarren
> <https://github.com/jywarren> do you know why this is happening?
Thanking
> you in advance!
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#3992 (comment)>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AABfJ_9JimkWW4eGCgxyGyewDkY3mIhFks5u52AdgaJpZM4Ymj0I
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3992 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARofxaKlJJ_3OAPQmtrcLR1pCpVDWBukks5u58CrgaJpZM4Ymj0I>
.
|
Hmm, @SidharthBansal do you have any ideas on this? |
Can you @shubhscoder please push in the failing tests so that we can help you? |
b0c50d2
to
f5b97ce
Compare
@SidharthBansal I have pushed the failing tests. Sorry for the delay! |
@SidharthBansal @jywarren I realised why the tests are failing. The users_controller_test is using the fixtures to get its object, where as the object gets updated in the users_controller, which updates it in the sql database, that is why the is_verified of the fixtures object never gets updated. I don't think there is a way to write tests for such a scenario. I have tested everything on the localhost I can make a video of the same to make sure that everything is working. Any help/ suggestion is welcome. Thank you so much! |
Minor changes Redirection of routes Added verification link in the welcome email Update is_verified only if user is not already verified Tests added fixed tests
d20d40f
to
b74bbcb
Compare
@SidharthBansal check if this looks good to you, or we need more changes. Thank you so much! |
@jywarren changes looks good to me. It is important PR so your careful review is must. |
@jywarren I think this is ready! You can check this? I can make any further changes if required. |
This is really nicely implemented, thanks! Just a few questions:
Thanks! |
|
This is great! Thank you for the clear response.
Great, this is fine. Let's make these follow-up steps in an issue and this can be merged! |
And... THANK YOU!!! 👍 👍 👍 |
<%= link_to "#{verifaction_link}", verifaction_link%> | ||
|
||
In case you are not able to click the link, try copy pasting the link in the browser. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jywarren make sure too copy this change to the welcome-email-body feature whenever you push this PR to production as the changes made here are just on the fallback email body and the production would send the email using the welcome-email-body feature's content(if it's present).
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, then this is an issue - we can't execute code in the features system, so this will need to be moved outside the <% end %>
on this line: https://github.com/publiclab/plots2/pull/3992/files/b74bbcbd3d85ff70b18bc7eae14bf79105270976#diff-a3214821bc5b12012e6fbb54ad82f05aR29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jywarren . Sorry but I am not getting what we are supposed to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I think I got it. We need to move the verification link and the corresponding instructions regarding the mail outside the if else block right? Because if body is present then the verification link wont appear , so we need to move it outside the block. I will make a new PR for that. Thank you so much for the help!
@shubhscoder do you see our comments above? I think this needs one more change, sorry! |
Yes, Shubham!
…On Sun, Feb 10, 2019 at 12:38 PM Shubham Sangamnerkar < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/views/welcome_mailer/notify_newcomer.html.erb
<#3992 (comment)>:
> @@ -18,6 +18,13 @@
Looking forward to hearing from you soon,
+ Please click on the link below to verify your email.
+
+ <% ***@***.***_token}" %>
+ <%= link_to "#{verifaction_link}", verifaction_link%>
+
+ In case you are not able to click the link, try copy pasting the link in the browser.
+
Oh I think I got it. We need to move the verification link and the
corresponding instructions regarding the mail outside the if else block
right?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3992 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AT6S9uvXm5KJVxZuC_NITFVhBt6zc8ABks5vL8WHgaJpZM4Ymj0I>
.
|
Minor changes Redirection of routes Added verification link in the welcome email Update is_verified only if user is not already verified Tests added fixed tests
Fixes #3850