I did this in the end, which might be useful in upgrading.
First off I had to upgrade devise from 3.2.2 to 3.4.1, as some methods in the recoverable module have changed.
In my mailer (rails 4.1):
def added_to_group(group_member)
@group = group_member.group
@member = group_member.member
@token = @member.create_reset_password_token
mail to: group_member.email,
subject: 'Somesite group membership notice'
end
In the mail template (plain text)
<%= edit_member_password_url(reset_password_token: @token) %>
the model method:
def create_reset_password_token
send :set_reset_password_token
end
This can probably be refactored (perhaps drop send, since it's a protected method on the same object) but I don't know if rails concerns do something weird there.
It seems like this should be public API. Don't see why we have to send a default email at the same time as set the token, rather than just set a token, or at least be able to specify which email gets sent.
May be a simple PR changing the set_reset_password_token method visibility & adding some tests?
Hope that helps.
Nick