Creating a PostgreSQL record via unique email in RubyOnRails project - ruby-on-rails

I hope you are well.
I need to generate unique email for users and allow them to send email to create a new post in their profile.
Example flow
User signs up
User gets username-withsomeuniqueaddition#myproduct.com
User send email to the address above
The product creates a record with the info from email body
Similar to how users can save links to their Instapaper account using email.
I spent hours googling but it all return how to send emails with RoR.
Is there any direction, tutorial or gem you can guide me?
Thank you, stay safe.

Related

appointment confirmations via email

I am interested in finding out how I can send my business customers appointment confirmation emails to their Gmail accounts and have their Google calander automatically populate the info and give them a reminder without any action required on their part. I know it's possible as I received such emails from companies that have done this. Can anyone please help? I'm not the most computer savvy person so I will need an explanation. thank you.
#carl grassl You will want to use EventReservation for appointment confirmations.
When you send your customer an email confirmation with EventReservation, this will automatically populate the info of the appointment in their Calendar, additionally, it will also trigger a Google Now card of the appointment.
Check out this tool below, logging in with your personal Gmail account:
http://gmail-actions.appspot.com
Once you've logged in, load the sample "Event card." You can send yourself an EventReservation email.
When you feel that you got everything locked in with your production email client, you'll have to register with Google to use schemas. Make sure your email is authenticated (DKIM/SPF). You can get all the details here:
https://developers.google.com/gmail/markup/registering-with-google

How do I associate notification mail reply to user's inbox?

I have an Rails web-application where a user can send message to any other registered user. Once a user sends a message to another user, another user gets a notification on application and also by email in his/her personal email inbox (Like basecamp).
I want to implement this functionality where if a user reply to a message from his/her personal email inbox(say gmail/yahoo), the message becomes available in the application and receiver gets a notification as usual.
As I could understand, we’ll need to associate a unique id and set it as reply-to field in notification mail. Any help in the right way to approach this problem will be very much appreciated.
Thank you
We are already using sendgrid. And sendgrid provides web-hook for emails. Which is quite easy to integrate with a rails application. It also uses mails gem. I'll keep posted if I find anything new on this.
I'm still working on finding out how to associate unique id in reply-to field in email. Any help on this will be much appreciated.
Thanks,
Chandan

Update user to avoid duplicate (devise+omniauth:twitter)

I created a rails app where users were able to signed up with devise ! But I just added omniauth-twitter - So now users can signed up with Twitter.
The problem is that some users already has their email adresses in the DB, so when they logged in using twitter, they are redirected to the final registration step, where they are supposed to add their email adress (because twitter doesn't give you the email adresses of their users).
What is the best way to deal with this concern ?
Should I reset my DB? so users will have to create a new account from scratch ? (easy steps with the twitter login)
Or is there a way to update the DB to allow duplicate of email for users who are already in the DB?
if someone can help me with this, I would highly appreciate!
This is the best guide out there for that. It worked for me.
http://www.orhancanceylan.com/rails-twitter-and-facebook-authentications-with-omniauth-and-devise/#comment-198

How to associate multiple emails for a single user in rails Devise gem

I am developing an application which uses Devise for user authentication. It performs all standard task that Devise handles (e.g.: Email verification during user sign up). But a user may have multiple email addresses to access his account and I want to verify all those addresses too.
My design is: user will get a email field in his profile page to add another email address to access his account along with his existing email address. After clicking submit, an email verification will occur like first time sign up process and user will be able to use both of this email address after successful verification.
Is there any gem available for this? If I need to implement it by myself, how can I do this without breaking the existing system?
It's very late to reply but recently I faced similar issue and found one gem which lets user have many emails, user can login with any email, set one email as primary, and provides support for confirmable, authenticable and validatable for each email.
Here is the link to gem:
https://github.com/allenwq/devise-multi_email
Hope it helps someone facing same situation :)

if I add SSO for both facebook and Gmail then should I treat users who login from both with same email id as new user?

I have created facebook sso and it works perfect.I am getting the email id as one of the unique factor in my server db .So it treats the user who has logged in the first time as new user and after submitting the form with extra info as already existing user.
I was thinking of adding gmail sso but my query is if the user in gmail with the same email id as the one he used to enter facebook account is already existing then should I treat him as existing user or new user as the email id is unique and already exists in the server db.
Or remove email id as the unique factor in the above case or just check if the user is signing in from facebook/gmail and then do the further verifications ? Please help me out with this .
Any help or link for the above query would help me a great deal.I would really appreciate any help.
Thanks in Advance.
I would say just allow the email to be the unique id. If user uses the same email for both accounts so be it. Many users of all social medias use one email to connect to all of their accounts.

Resources