1

I'm using devise for authentication in my app. When a user signs up a confirmation email is sent to the user which says

Welcome user@gmail.com !

You can confirm your account email through the link below:

Confirm my account

But I want to display user's name instead of email. How can I implement this? PLease help. I have devise viewws with me. But it uses an @email instance variable to display email. Where is it defined? Help would be appreciated.

<p>Welcome <%= @email %>!</p>

<p>You can confirm your account email through the link below:</p>

<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %></p>
Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78

1 Answers1

6

@resource is likely to be your user.

So replace @email (defined in the devise mailer) with @resource.name (or whatever method you use to get the name)

apneadiving
  • 114,565
  • 26
  • 219
  • 213