# Rule to conditionally send email template

**URL:** <https://community.auth0.com/t/rule-to-conditionally-send-email-template/9251>\
**Category:** Get Help\
**Tags:** email-template\
**Created:** [January 21, 2018, 4:23am UTC](https://community.auth0.com/t/rule-to-conditionally-send-email-template/9251 "2018-01-21T04:23:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v-joe](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@v-joe](https://community.auth0.com/u/v-joe)\
**Post date:** [January 21, 2018, 4:23am UTC](https://community.auth0.com/t/rule-to-conditionally-send-email-template/9251/1 "2018-01-21T04:23:04Z")

</div>

I have a rule with the following content:

```
function (user, context, callback) {
	var email_verified = user && user.user_metadata && user.user_metadata.email_verified;
	var loginsCount = context && context.stats && context.stats.loginsCount;
	var shouldSendEmail = !email_verified && loginsCount <= 1;

	if (shouldSendEmail) {
		console.log("SHOULD SEND VERIFICATION EMAIL");
	} else {
		return callback(null, user, context);
	}
}

```

This is working as expected, but I would like to trigger the Verification Email template where the `console.log` is. I’ve read the [Conditionally send email verification](http://community.auth0.com/questions/1671/conditionally-send-email-verification) ticket and that helped, but I do not understand how to trigger an email template to be sent.

Any assistance is appreciated.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [December 14, 2018, 6:02pm UTC](https://community.auth0.com/t/rule-to-conditionally-send-email-template/9251/2 "2018-12-14T18:02:51Z")

</div>

As it has been more than a few months since this topic was opened, and there has been no reply or further information provided as to the existence of the issue, we are closing this topic. Please don’t hesitate to create a new topic if this issue is still present, we would be happy to work with you to help find a resolution.

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [December 14, 2018, 6:02pm UTC](https://community.auth0.com/t/rule-to-conditionally-send-email-template/9251/3 "2018-12-14T18:02:55Z")

</div>


