Email Sending event - email.Recipient

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
eftal
User
Posts: 6

Email Sending event - email.Recipient

Post by eftal »

Hello, I want to send an e-mail to the above sql query (MyMeilField) list. Can you help with the syntax? thanks in advance

// Email Sending event
public bool Email_Sending(Email email, dynamic args) {
	//Log(email);

var eftal=ExecuteScalar("SELECT ID=COUNT(1) FROM PERSONEL_TALEP where ONAY_DURUM=0 ");

//var MyMailField ="SELECT MAIL FROM EMPLOYEES";/????

string sql = "SELECT ID, ADI, SOYADI,CALISMA_YERI, ISBASITARIH,YUKLENICI, KAYIT_TARIH,ONAY_DURUM FROM PERSONEL_TALEP";

var options = new Dictionary<string, object>();
options.Add("fieldcaption", true);
options.Add("tablename", new List<string>() {"PERSONEL_TALEP"});
options.Add("tableclass", "table table-bordered table-sm"); 
var content = ExecuteHtml(sql, options);

if (ConvertToInt(eftal)> 0) { // If Add page

		email.Recipient = ......;// Change recipient to a field value in the new record
		  
		email.Subject = "Deneme Konu"; // Change subject
        email.Content = "deneme" + content + "etc....";
	
	}
	return true;
	
}

eftal
User
Posts: 6

Post by eftal »

thanks problem solved.

// Email Sending event
public bool Email_Sending(Email email, dynamic args) {
	//Log(email);

var eftal=ExecuteScalar("SELECT ID=COUNT(1) FROM PERSONEL_TALEP where ONAY_DURUM=0 "); 

var MyEmailField=ExecuteScalar("SELECT DISTINCT REPLACE((SELECT RTRIM(MAIL) [data()] FROM EMPLOYEES WHERE UserLevel=-1 FOR XML PATH('')),' ',';')FROM EMPLOYEES"); //mail atılscsk kişi

string sql = "SELECT ID, ADI, SOYADI,CALISMA_YERI, ISBASITARIH,YUKLENICI, KAYIT_TARIH,ONAY_DURUM, ONAY_TARIHI,POZISYON, where ONAY_DURUM=0"; // 

var options = new Dictionary<string, object>();
options.Add("fieldcaption", true);
options.Add("tablename", new List<string>() {"PERSONEL_TALEP"});
options.Add("tableclass", "table table-bordered table-sm"); 
var content = ExecuteHtml(sql, options);

if (ConvertToInt(eftal)> 0) { // If Add page
	        email.Recipient = Convert.ToString(MyEmailField); // mail atılacak liste
	
		email.Subject = "Deneme Konu"; // konu
		email.Content ="mail içerik" + content  + "etc...."; //içerik content yukarıda tanımlanan html tablo
	
	}
	return true;
	
}

Post Reply