Sindbad~EG File Manager

Current Path : /home/numerotech/test-certificates.numerotech.com/test_certificate_v1/core/library/
Upload File :
Current File : //home/numerotech/test-certificates.numerotech.com/test_certificate_v1/core/library/email.py

from flask import request, url_for,flash, render_template
from core import app
from flask import url_for
from datetime import datetime, date, time, timedelta
import requests,mandrill,json



class EMAIL:
	def sendMail(subject,html,to,conf):
		# to = "ganesan@numerotec.com"  # for test use
		# MANDRILL_API_KEY='MAoeFJshVAG4-xTyPpTgUg'
		if to:
			MANDRILL_API_KEY='XEs1ytJQpEwaZSq25YgB4Q' # IP ADDRESS ENABLED
			mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)

			message = {'subject' : subject, 'recipients':to,'from_name': conf['conf_title'],
			'html': html, 'from_email' : conf['from_email'],
			"headers" :{"Reply-To": conf['reply_to']} ,'to' : [{'email':to,'name':to,'type':'to'},{'email':conf['backup_email'],'name':to,'type':'cc'}] }

			result = mandrill_client.messages.send(message = message,send_async=True)
			return ('success')

		else:
			return ('Email Id is Blank')
		
	# The below function updated by Ganesan 2022-11-05 13:00:00	
	def KcReportMail(subject,html,to):
		# MANDRILL_API_KEY='MAoeFJshVAG4-xTyPpTgUg'
		MANDRILL_API_KEY='3rql7lHFpPcoHnNAWYQTFQ' # IP ADDRESS ENABLED
		mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)
 
		message = {'subject' : subject, 'recipients':to,'from_name': 'Kit counter report',
		'html': html, 'from_email' : 'support@numerotec.com',
		"headers" :{"Reply-To": "support@numerotec.com"} ,'to' : [{'email':to,'name':to,'type':'to'},{'email':'ganesan@numerotec.com','name':to,'type':'to'}] }
 
		result = mandrill_client.messages.send(message = message,send_async=True)
		return ('success')

	def FcReportMail(subject,html,to):
		# MANDRILL_API_KEY='MAoeFJshVAG4-xTyPpTgUg'
		MANDRILL_API_KEY='3rql7lHFpPcoHnNAWYQTFQ' # IP ADDRESS ENABLED
		mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)
 
		message = {'subject' : subject, 'recipients':to,'from_name': 'Food counter report',
		'html': html, 'from_email' : 'support@numerotec.com',
		"headers" :{"Reply-To": "support@numerotec.com"} ,'to' : [{'email':to,'name':to,'type':'to'}] }
 
		result = mandrill_client.messages.send(message = message,send_async=True)
		return ('success')		

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists