• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.validate_email_add函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中webnotes.utils.validate_email_add函数的典型用法代码示例。如果您正苦于以下问题:Python validate_email_add函数的具体用法?Python validate_email_add怎么用?Python validate_email_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了validate_email_add函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: validate_email

	def validate_email(self):
		if self.doc.company_email and not validate_email_add(self.doc.company_email):
			msgprint("Please enter valid Company Email")
			raise Exception
		if self.doc.personal_email and not validate_email_add(self.doc.personal_email):
			msgprint("Please enter valid Personal Email")
			raise Exception
开发者ID:BillTheBest,项目名称:erpnext,代码行数:7,代码来源:employee.py


示例2: validate

	def validate(self):
		from webnotes.utils import validate_email_add
		# validate ids
		if self.sender and (not validate_email_add(self.sender)):
			raise Exception, "%s is not a valid email id" % self.sender

		if self.reply_to and (not validate_email_add(self.reply_to)):
			raise Exception, "%s is not a valid email id" % reply_to

		for e in self.recipients:
			if not validate_email_add(e):
				raise Exception, "%s is not a valid email id" % e	
开发者ID:ranjithtenz,项目名称:stable,代码行数:12,代码来源:email_lib.py


示例3: _validate

		def _validate(email):
			"""validate an email field"""
			if email:
				if "," in email:
					email = email.split(",")[-1]
				if not validate_email_add(email):
					# try extracting the email part and set as sender
					new_email = extract_email_id(email)
					if not (new_email and validate_email_add(new_email)):
						webnotes.msgprint("%s is not a valid email id" % email,
							raise_exception = 1)
					email = new_email
			return email
开发者ID:appost,项目名称:wnframework,代码行数:13,代码来源:smtp.py


示例4: add_profile

def add_profile(email):
	from webnotes.utils import validate_email_add
	from webnotes.model.doc import Document
			
	sql = webnotes.conn.sql
	
	if not email:
		email = webnotes.form_dict.get('user')
	if not validate_email_add(email):
		raise Exception
		return 'Invalid Email Id'
	
	if sql("select name from tabProfile where name = %s", email):
		# exists, enable it
		sql("update tabProfile set enabled = 1, docstatus=0 where name = %s", email)
		webnotes.msgprint('Profile exists, enabled it')
	else:
		# does not exist, create it!
		pr = Document('Profile')
		pr.name = email
		pr.email = email
		pr.enabled=1
		pr.user_type='System User'
		pr.save(1)
		from webnotes.model.code import get_obj
		pr_obj = get_obj(doc=pr)
		pr_obj.on_update()
开发者ID:Morphnus-IT-Solutions,项目名称:trimos,代码行数:27,代码来源:my_company.py


示例5: validate_email_type

	def validate_email_type(self, email):
		from webnotes.utils import validate_email_add
	
		email = email.strip()
		if not validate_email_add(email):
			webnotes.msgprint("%s is not a valid email id" % email)
			raise Exception
开发者ID:saurabh6790,项目名称:alert-med-lib,代码行数:7,代码来源:profile.py


示例6: add_profile

def add_profile(args):
	from webnotes.utils import validate_email_add
	from webnotes.model.doc import Document
	email = args['user']
			
	sql = webnotes.conn.sql
	
	if not email:
		email = webnotes.form_dict.get('user')
	if not validate_email_add(email):
		raise Exception
		return 'Invalid Email Id'
	
	if sql("select name from tabProfile where name = %s", email):
		# exists, enable it
		sql("update tabProfile set enabled = 1, docstatus=0 where name = %s", email)
		webnotes.msgprint('Profile exists, enabled it')
	else:
		# does not exist, create it!
		pr = Document('Profile')
		pr.name = email
		pr.email = email
		pr.first_name = args.get('first_name')
		pr.last_name = args.get('last_name')
		pr.enabled = 1
		pr.user_type = 'System User'
		pr.save(1)

		if args.get('password'):
			sql("""
				UPDATE tabProfile 
				SET password = PASSWORD(%s)
				WHERE name = %s""", (args.get('password'), email))
开发者ID:calvinfroedge,项目名称:erpnext,代码行数:33,代码来源:my_company.py


示例7: _validate

		def _validate(email):
			"""validate an email field"""
			if email and not validate_email_add(email):
				throw("{email} {msg}".format(**{
					"email": email,
					"msg": _("is not a valid email id")
				}))
			return email
开发者ID:bindscha,项目名称:wnframework_old,代码行数:8,代码来源:email_body.py


示例8: validate

	def validate(self):
		"""validate the email ids"""
		if not self.sender:
			self.sender = webnotes.conn.get_value('Email Settings', None, 'auto_email_id') \
				or getattr(conf, 'auto_email_id', 'ERPNext Notification <[email protected]>')

		from webnotes.utils import validate_email_add
		# validate ids
		if self.sender and (not validate_email_add(self.sender)):
			webnotes.msgprint("%s is not a valid email id" % self.sender, raise_exception = 1)

		if self.reply_to and (not validate_email_add(self.reply_to)):
			webnotes.msgprint("%s is not a valid email id" % self.reply_to, raise_exception = 1)

		for e in self.recipients + (self.cc or []):
			if e.strip() and not validate_email_add(e):
				webnotes.msgprint("%s is not a valid email id" % e, raise_exception = 1)
开发者ID:masums,项目名称:wnframework,代码行数:17,代码来源:smtp.py


示例9: send_email_notification

	def send_email_notification(self):
		if not validate_email_add(self.doc.email_id.strip(' ')):
			msgprint('error:%s is not a valid email id' % self.doc.email_id.strip(' '))
			raise Exception
		else:
			subject = 'Thank you for interest in erpnext'
			 
			sendmail([self.doc.email_id.strip(' ')], sender = sender_email[0][0], subject = subject , parts = [['text/html', self.get_notification_msg()]])
			msgprint("Mail Sent")
开发者ID:NorrWing,项目名称:erpnext,代码行数:9,代码来源:lead.py


示例10: validate

 def validate(self):
   if self.doc.personal_email:
     if not validate_email_add(self.doc.personal_email):
       msgprint("Please enter valid Personal Email")
       raise Exception
   ret = sql("select name from `tabEmployee Profile` where employee = '%s' and name !='%s'"%(self.doc.employee,self.doc.name))
   if ret:
     msgprint("Employee Profile is already created for Employee : '%s'"%self.doc.employee)
     raise Exception
开发者ID:antoxin,项目名称:erpnext,代码行数:9,代码来源:employee_profile.py


示例11: validate

	def validate(self):
		"""
		validate the email ids
		"""
		if not self.sender:
			self.sender = webnotes.conn.get_value('Control Panel',None,'auto_email_id')

		from webnotes.utils import validate_email_add
		# validate ids
		if self.sender and (not validate_email_add(self.sender)):
			webnotes.msgprint("%s is not a valid email id" % self.sender, raise_exception = 1)

		if self.reply_to and (not validate_email_add(self.reply_to)):
			webnotes.msgprint("%s is not a valid email id" % self.reply_to, raise_exception = 1)

		for e in self.recipients:
			if not validate_email_add(e):
				webnotes.msgprint("%s is not a valid email id" % e, raise_exception = 1)
开发者ID:beliezer,项目名称:wnframework,代码行数:18,代码来源:send.py


示例12: validate_notification_email_id

	def validate_notification_email_id(self):
		if self.doc.notification_email_address:
			from webnotes.utils import validate_email_add
			for add in self.doc.notification_email_address.replace('\n', '').replace(' ', '').split(","):
				if add and not validate_email_add(add):
					msgprint("%s is not a valid email address" % add, raise_exception=1)
		else:
			msgprint("Notification Email Addresses not specified for recurring invoice",
				raise_exception=1)
开发者ID:trycatcher,项目名称:erpnext,代码行数:9,代码来源:sales_invoice.py


示例13: validate_email_type

	def validate_email_type(self, email):
		from webnotes.utils import validate_email_add
	
		email = email.strip()
		if not validate_email_add(email):
			throw("{email} {msg}".format(**{
				"email": email, 
				"msg": _("is not a valid email id")
			}))
开发者ID:bindscha,项目名称:wnframework_old,代码行数:9,代码来源:profile.py


示例14: validate

	def validate(self):
		self.set_status()
		
		if self.doc.source == 'Campaign' and not self.doc.campaign_name and session['user'] != 'Guest':
			webnotes.throw("Please specify campaign name")
		
		if self.doc.email_id:
			if not validate_email_add(self.doc.email_id):
				webnotes.throw('Please enter valid email id.')
开发者ID:saurabh6790,项目名称:tru_app_back,代码行数:9,代码来源:lead.py


示例15: validate

	def validate(self):
		"""
		validate the email ids
		"""
		if not self.sender:
			self.sender = hasattr(conf, 'auto_email_id') \
					and conf.auto_email_id or '"ERPNext Notification" <[email protected]>'

		from webnotes.utils import validate_email_add
		# validate ids
		if self.sender and (not validate_email_add(self.sender)):
			webnotes.msgprint("%s is not a valid email id" % self.sender, raise_exception = 1)

		if self.reply_to and (not validate_email_add(self.reply_to)):
			webnotes.msgprint("%s is not a valid email id" % self.reply_to, raise_exception = 1)

		for e in self.recipients:
			if not validate_email_add(e):
				webnotes.msgprint("%s is not a valid email id" % e, raise_exception = 1)
开发者ID:NorrWing,项目名称:wnframework,代码行数:19,代码来源:send.py


示例16: validate

	def validate(self):
		if self.doc.email_id and not validate_email_add(self.doc.email_id):
				msgprint("Please enter valid Email Id", raise_exception=1)
		if not self.doc.warehouse_type:
			msgprint("Warehouse Type is Mandatory", raise_exception=1)
			
		wt = sql("select warehouse_type from `tabWarehouse` where name ='%s'" % self.doc.name)
		if wt and cstr(self.doc.warehouse_type) != cstr(wt[0][0]):
			sql("""update `tabStock Ledger Entry` set warehouse_type = %s 
				where warehouse = %s""", (self.doc.warehouse_type, self.doc.name))
开发者ID:MiteshC,项目名称:erpnext,代码行数:10,代码来源:warehouse.py


示例17: autoname

	def autoname(self):
		import re
		from webnotes.utils import validate_email_add

		self.doc.email = self.doc.email.strip()
		if self.doc.name not in ('Guest','Administrator'):
			if not validate_email_add(self.doc.email):
				msgprint("%s is not a valid email id" % self.doc.email)
				raise Exception
				self.doc.name = self.doc.email
开发者ID:ranjithtenz,项目名称:wnframework,代码行数:10,代码来源:profile.py


示例18: validate

	def validate(self):
		if self.doc.status == 'Lead Lost' and not self.doc.order_lost_reason:
			webnotes.throw("Please Enter Lost Reason under More Info section")
		
		if self.doc.source == 'Campaign' and not self.doc.campaign_name and session['user'] != 'Guest':
			webnotes.throw("Please specify campaign name")
		
		if self.doc.email_id:
			if not validate_email_add(self.doc.email_id):
				webnotes.throw('Please enter valid email id.')
开发者ID:Carloshsiqueira,项目名称:erpnext,代码行数:10,代码来源:lead.py


示例19: sent_mail

 def sent_mail(self):
   if not self.doc.subject or not self.doc.message:
     msgprint("Please enter subject & message in their respective fields.")
   elif not self.doc.email_id1:
     msgprint("Recipient not specified. Please add email id in 'Send To'.")
     raise Exception
   else :
     if not validate_email_add(self.doc.email_id1.strip(' ')):
       msgprint('error:%s is not a valid email id' % self.doc.email_id1)
     else:
       self.send_emails([self.doc.email_id1.strip(' ')], subject = self.doc.subject ,message = self.doc.message)
开发者ID:tobrahma,项目名称:erpnext,代码行数:11,代码来源:enquiry.py


示例20: on_login

def on_login(login_manager):
	from webnotes.utils import validate_email_add
	if "demo_notify_url" in webnotes.conf:
		if webnotes.form_dict.lead_email and validate_email_add(webnotes.form_dict.lead_email):
			import requests
			response = requests.post(webnotes.conf.demo_notify_url, data={
				"cmd":"erpnext.templates.utils.send_message",
				"subject":"Logged into Demo",
				"sender": webnotes.form_dict.lead_email,
				"message": "via demo.erpnext.com"
			})
开发者ID:anandpdoshi,项目名称:erpnext_demo,代码行数:11,代码来源:utils.py



注:本文中的webnotes.utils.validate_email_add函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python email_lib.sendmail函数代码示例发布时间:2022-05-26
下一篇:
Python utils.sendmail函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap