mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
added footer subscribe and blog settings
This commit is contained in:
@@ -99,10 +99,8 @@ def add_comment(args=None):
|
||||
return comment_html
|
||||
|
||||
@webnotes.whitelist(allow_guest=True)
|
||||
def add_subscriber():
|
||||
def add_subscriber(name, email_id):
|
||||
"""add blog subscriber to lead"""
|
||||
full_name = webnotes.form_dict.get('your_name')
|
||||
email = webnotes.form_dict.get('your_email_address')
|
||||
name = webnotes.conn.sql("""select name from tabLead where email_id=%s""", email)
|
||||
|
||||
from webnotes.model.doc import Document
|
||||
@@ -114,14 +112,13 @@ def add_subscriber():
|
||||
if not lead.source: lead.source = 'Blog'
|
||||
lead.unsubscribed = 0
|
||||
lead.blog_subscriber = 1
|
||||
lead.lead_name = full_name
|
||||
lead.lead_name = name
|
||||
lead.email_id = email
|
||||
lead.save()
|
||||
|
||||
|
||||
def get_blog_content(blog_page_name):
|
||||
import website.utils
|
||||
content = website.utils.get_html(blog_page_name)
|
||||
content = split_blog_content(content)
|
||||
import webnotes.utils
|
||||
content = webnotes.utils.escape_html(content)
|
||||
return content
|
||||
|
||||
@@ -59,7 +59,7 @@ def generate():
|
||||
blog_list = webnotes.conn.sql("""\
|
||||
select page_name as name, modified, creation, title from `tabBlog Post`
|
||||
where ifnull(published,0)=1
|
||||
order by creation desc, modified desc, name asc limit 100""", as_dict=1)
|
||||
order by creation desc, modified desc, name asc limit 20""", as_dict=1)
|
||||
|
||||
for blog in blog_list:
|
||||
blog.link = host + '/' + blog.name + '.html'
|
||||
|
||||
Reference in New Issue
Block a user