I am using Devise for registration of a site with confirmable. However, I have two different roles for this site. The first role is the "main" role that uses the regular Devise signup procedure. Accounts in a second role are supposed to be created after the original user confirms their account, logs in for the first time and saves a certain model. For example, if a user signs up for the site (as role type 1) the get a confirmation email from Devise as normal. Next, they visit the confirmation link, verify their account and then fill out a form where they specify some friends that should also get accounts. The friends are role type 2 and they should get a different confirmation email than the original person who signed up their friends for the account. The accounts for the friends are created when the form filled out by the original user is saved. In addition, a person can edit and add more friends later so accounts might also need to be created on the update method of the relevant form/object and those new users will need to be sent the correct email. To be clear, I do not want to skip confirmation - I just want to send different confirmation emails to the user depending on their roles. I cannot figure out how to handle this properly. If I try to create the friends accounts in code when the form is saved with User.new, calling user.skip_confirmation! will automatically confirm them. However, I do not want anyone automatically confirmed - I just want to select a different customizable confirmation email to send depending on various conditions. Can someone point me in the right direction?
Send custom confirmation email in Devise depending on role defined in the database
774 Views Asked by Tree At
1
There are 1 best solutions below
Related Questions in RUBY-ON-RAILS
- Rails HABTM: Select everything a that a record 'has'
- Best way to make an HABTM association via console
- dynamically create an ical / ics file from a rails model
- Ruby destroy is not working? Or objects still present?
- NoMethodError: undefined method `update_average_rating' for nil:NilClass
- Select results where joined table contains records with an attribute, but without another
- Showing posts only created when boolean was true
- Ruby on rails and HAML - Print a hash with background color
- How can I monitor an endpoint's status with Ruby?
- How to create dynamic pages without form_for helper in Rails?
- Rails 4.2 jQuery loads only after refresh
- "Access Denied" - User's Permissions to S3 Bucket
- ActiveRecord, Rails 4: has_many :through with scoped conditions failure
- Rails - formatting a list of options
- Rails - Ajax do not work properly on production server
Related Questions in AUTHENTICATION
- Access roles from multiple applications
- Different storyboard's entry points depending on a parameter
- SoundCloud Authentication Consistently Returns 401 invalid_grant For Some Users
- sendxmpp not authorized failure (Error AuthSend)
- Retrieve user information from Active Directory on login
- Log in through active directory
- Ember.js REST Auth Headers
- Validate Deezer access token on server
- Why does IIS Anonymous Authentication turn on by itself after I publish my project to server?
- Laravel - session data survives log-out/log-in, even for different users
- How can I share Azure Active Directory authentication between server side and client script?
- django rest framework - token authentication logout
- NameValuePair, HttpParams, HttpConnection Params deprecated on server request class for login app
- How to delete user from _User through Parse REST API
- Cannot login with new SQL User - SQL 2014
Related Questions in DEVISE
- Devise throws 401 unauthorized and redirects only in Production/Staging
- How to use embedded Ruby HTML files with Ionic and Cordova
- Connecting ios app to a rails app that uses pow and devise
- Devise authenticating with additional field company_id
- using devise WITHOUT the gem, can I simply copy the files?
- Erro uninitialized constant Devise::OmniAuthCallbacksController
- Devise - change error message without hardcoded in yml
- Rails how to make this view work? Devise, Enrolment system with courses
- authentication ruby valid_password error
- Get the user id of a newly created user and put it into nested form
- Devise conflicting with other routes using delete
- Rails 4 how to make enrolment to a course for users (controller, view, model)
- Instance variable in partial view
- Already logged in on Facebook, why the need to re-authenticate when using Devise
- Sending MailChimp email with Rails
Related Questions in CONFIRMATION
- magento: extra email recipients in order confirmation email
- Show yes/no instead of OK in confirmation dialog
- Google consent screen not shown as expected
- PHP Form Confirmation Parse Error
- Unable to register as developer: Not receiving confirmation code
- confirm comment by email on Rails
- Alternetives to sendmail.exe to send confirmation emails?
- How do I make my program ask for confirmation when using a speech command?
- Confirmation box from server side in asp.net
- trouble with confirmationboxes when submitting a form
- How to implement a confirmation (yes/no) DialogPreference?
- Deletion Confirmation in Web-based application
- Rails 4.0, Issues for email confirmation in devise plugin
- Using JavaScript for form confirmation message (with Zoho contact form)
- What is the best way to indicate that a substitution needs a confirmation dialogue?
Related Questions in CONFIRMATION-EMAIL
- Google Forms Confirmation Email with Information From Linked Sheet
- Zend framework registration + email confirmation
- Laravel 4: how to make confirmation email?
- Devise "Confirm account instructions email" takes me to "Reset Password"
- PHP/MYSQL - Subscription Email - How do they accomplish something like this?
- how do I confirm old users retroactively with Devise?
- Rails: Devise: post-confirmation error
- Design dilemma: If e-mail address already used, send e-mail "e-mail address already registered", but can't because can't add duplicate to table
- Devise / ActionMailer sending duplicate emails for registration confirmation
- Confirm multiple emails with devise
- Once app is launched to Azure, the confirmation email is not being sent. Anyone know why?
- Magento 1.8.1.0 Order Confirmation Emails - Send the email again to sales only
- Verify Email and Update MySQL DB Column
- Send custom confirmation email in Devise depending on role defined in the database
- Should we ask users to confirm an e-mail address when they change it?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Check out
send_on_create_confirmation_instructionsmethod and comments for it in your /gems/devise-x.x.x/lib/devise/models/confirmable.rb