- Download the Rules module
- Enable Rules and Rules UI
Add a new rule
- React on event: After Saving New Content (it's listed under NODE)
- Restrict by type: select your content type (ex: Article)Hotel
Under Action
- Add Action of Create New Entity >> ENTITY TYPE: USER >> For your EMAIL field, Ex: If you called your field "Email" then it's node:field-email.
For user name, I guess you will also need to create a field in the node for that too. Then do same steps as e-mail
Note: You can always click on "DATA SELECTORS" to see all the tokens you can use.
- Add Action of Set data value >> select your entity ref field (Ex: If you called your field "Test" then it's node:field-test) >> for Value use entity-created:uid
- Add action of Send Account Email (
listed under USER
) >> Account: entity-created
You can modify the e-mail templates here
/admin/config/people/accounts
use tokens for your needs.Let me know how this goes, no time to test this Rule.