Project

General

Profile

Send account information when changing password on the console or with a script

Added by Frank Brenner about 11 years ago

Hello,

I need to script changing a group of users from LDAP auth to local auth. This seems to work fine from the console:

> user = User.find_by_login('joe')
> user.auth_source_id = nil
> user.random_password
> user.save

However, no mail is sent to the user with the new password.

According to the docs, it should be possible to send account information using the account_information method of the Mailer class:

- (Object) account_information(user, password)

Builds a tmail object used to email the specified user their account information.

Example:

account_information(user, password) => tmail object
Mailer.deliver_account_information(user, password) => sends account information to the user

However, Mailer.account_information does not seem to be available to the console, although I find its definition in app/models/mailer.rb

How can I have account information sent?

Thanks!


Replies (1)

RE: Send account information when changing password on the console or with a script - Added by Djordjije Crni over 8 years ago

Hello,

I have the same problem, as Frank described almost three years ago.

Thanks in advanced!

    (1-1/1)