The CreatorCon Call for Content is officially open! Get started here.

how can I send email by clicking Send button in a widget

Imatiaz
Kilo Contributor

Basically 

I have a widget that has an "Email / Mail " button when clicking on it it should open the email window so that I can enter an email address and compose an email and send it.

 

@Ankur Bawiskar @Pradeep Sharma @Pranav Bhagat 

6 REPLIES 6

Pranesh072
Mega Sage

try this

html 

<a href="" ng-click="c.mailTo()"><i class="fa fa-envelope" aria-hidden="true"></i> Mail </a>

 

Client controller

function($scope, $window){
	var c= this;
	
	c.mailTo = function() {  
        var url = "mailto:?subject=Emailsubject&body=emailbody";
        $window.open(url, '_self');
    };
}

Ankur Bawiskar
Tera Patron
Tera Patron

@Nora 

sharing some links for help

Custom button on Service Portal to send email

In server script of your widget, you can create event and this event will be captured by email notification.

Below article will give you code configure button and you can reuse this code to create your own widget and update server script of widget to generate event.

Create custom action buttons in Service Portal

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Nora 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Pranav Bhagat
Kilo Sage

Just use mail to option

<p><a href="mailto:someone@example.com">Send email</a></p>

 

 Also if you found the solution for your other questions, please consider marking the correct answer to close the thread.