I'm using rails 2.3.5 and devise 1.0.6.
I'm having users confirm account's with email.
However, when a new user sign's up the flash notice says "The user was successfully created" which it was but it doesn't tell the user that they need to confirm their their email unless they try to log in and devise's flash notice still doesn't explain that they have to confirm through email.
Where is this flash notice located in the gem and how can I change it? Or what is a better way to fix this problem.
Just enable i18n in your project and edit the default locale (en.devise.yml) or download new ones from
https://github.com/plataformatec/devise/wiki/i18n
Flash messages for the devise gem can be altered in the locales directory (YourRailsApp/config/locales/devise.en.yml).
Just change the devise.en.yml to your liking, it doesn't really take any programming knowledge.
If you are new to rails the locales directory is for I18n translations which is rails way of translating words albeit statically but it works well for simple projects.
Related
I have what should be a very basic setup with the Recaptcha gem. It is showing all the appropriate on-page behavior: A recaptcha "I am not a robot" box appears on the sign up screen and is checkable by the user.
However, if I try and submit the sign in form without checking the box, it still goes through instead of showing an error message.
I followed the Gem's instructions pretty much verbatim:
I created the appropriate keys on Google's website and put them into
Heroku's variable storage successfully.
I put gem 'recaptcha' in my Gemfile and bundled.
I added <%= recaptcha_tags %> in my sign up form (Devise new user
registration).
I changed my create method to include if verify_recaptcha(model:
#user) && #user.persisted? in my registrations controller.
The box is showing up perfectly, but the user is able to create a new account even without checking the recaptcha box!
Can anyone see where I'm going wrong here? You can see the issue live here if you need to Google inspector it...
So I know I can install the mailer gem from here:
https://guides.spreecommerce.com/user/configuring_mail_methods.html
But it clearly says that generic action mailer settings are more favourable at the top of the page.
I have installed postmark which is sending emails fine in an extension I built. However Spree does not appear to be sending emails when I create an order for a customer. How can I turn these transactional emails on without the Spree mailer gem, as I want to use postmark on its own.
Also where the hell is the listed email section from the documentation?
https://guides.spreecommerce.com/developer/deployment_tips.html
Thanks for any help!
You can set up emails by adding the gem at https://github.com/spree-contrib/spree_mail_settings
Not sure if the message at the top of the page has been changed since this question was posted but it says to use that gem now.
Add gem 'spree_mail_settings', github: 'spree-contrib/spree_mail_settings' to you gemfile and you will get a new page in the admin settings for setting up your email
An update for those facing this issue in 2021:
It's not recommended to use this gem. Instead, use a standard rails configuration: https://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
This guide on how to fix extensions for Spree 4+ may also come in handy: https://guides.spreecommerce.org/developer/contributing/upgrading_extensions.html
If anyone is desperately in need of this extension, feel free to submit a pull request!
I have been unable to get Spree to send a copy of an order confirmation email after an order is placed. The customer gets the order confirmation however. I can intercept the order confirmation email as well. I have added my email in the Spree Admin "Send Copy of all mails to", as well as having tried adding config.mail_bcc = "contact#mydomain.com" in the config/initializers/spree.rb. I checked the params when I update the Admin, and it does correctly send the mail_bcc = 'contact#mydomain.com'. Any thoughts?
Spree 2.0 has some e-mail settings in the admin area which are a bit problematic. I generally recommend setting:
# config/initializers/spree.rb
Spree.config do |config|
config.override_actionmailer_config = false
end
This will allow you to use the default ActionMailer configuration. Without this setting, Spree will use its own code to handle mail configuration through the admin area.
For more information see:
Spree Deployment Tips
Example ActionMailer Configuration
I'm using devise gem to implement authentication in my Ruby On Rails application. Sometimes error messages are displayed such as:
Prohibited an error being wellness saved from this user: Password is
too short (minimum is 6 characters)
What is the best way to translate these messages to another language?
Go to config/locales and copy devise.en.yml, giving the file a name like devise.other_language_initials.yml. Then add your own translations.
For more info on how to translate your application, go here.
The fastest way is downloading a translation file to the language you want. You can find more about in this link.
What you are going to find there is a bunch of files in different languages for Devise flash notifications that you can download and add to you application under config/locales.
Hope that helps you! :)
I'm using Devise for authentication, and I'm confused on how to set up mail along with it. Should you still be creating your own mailer and initializer file, or should you be sending all mail through Devise? Where do you go in Devise to create the email template and the method for sending the email?
I realize this is kind of a broad question, so essentially I'm asking what is the best way to set up mail with Devise?
Also, if you wanted to send an email to a user after they have confirmed their email, how would you do this?
Devise does create it's own Mailer--if you take a look on GitHub https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb you can see that it comes with a bunch of methods already packaged in.
You can go ahead and generate the views for these methods using the command
rails g devise views
and then edit them.
If you would like to send additional email messages you should create your own Mailer to do so. I would recommend http://edgeguides.rubyonrails.org/action_mailer_basics.html . It's a pretty good overview of how to set up a mailer from the ground up.
Devise creates the mailer and email templates for you, so you don't have to worry about that. However, if you want to change the email templates, install devise views using the command:
rails g devise:views
This will add a new "devise" folder in your views. You can find all the email templates in the mailer folder under views/devise.
Use the confirmable attribute to send confirmation emails to users post registration.
By default, this attribute is commented out. So, once you install devise using the command rails g devise:install, go to db/migrate and locate the devise_create_users migration and uncomment the following lines:
t.confirmable and
add_index :users, :confirmation_token, :unique => true.
Once done, migrate your database.
Now go to your user model and check if devise has the :confirmable attribute, if not add it and you are all set.