# Path: fooltrader/settings.py
# SMTP_HOST = 'smtpdm.aliyun.com'
# 
# SMTP_PORT = '80'
# 
# EMAIL_PASSWORD = ''
# 
# EMAIL_USER_NAME = ''
# 
# WEIXIN_APP_ID = ""
# 
# WEIXIN_APP_SECRECT = ""


import email
import json
import logging
import smtplib
import requests
import schedule
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from fooltrader.settings import SMTP_HOST, SMTP_PORT, EMAIL_PASSWORD, EMAIL_USER_NAME, WEIXIN_APP_ID, WEIXIN_APP_SECRECT
        # {
        #     "template_id": "mkqi-L1h56mH637vLXiuS_ulLTs1byDYYgLBbSXQ65U",
        #     "title": "涨跌幅提醒",
        #     "primary_industry": "金融业",
        #     "deputy_industry": "证券|基金|理财|信托",
        #     "content": "{{first.DATA}}\n股票名：{{keyword1.DATA}}\n最新价：{{keyword2.DATA}}\n涨跌幅：{{keyword3.DATA}}\n{{remark.DATA}}",
        #     "example": "您好，腾新控股最新价130.50元，上涨达到设置的3.2%\r\n股票名：腾讯控股（00700）\r\n最新价：130.50元\r\n涨跌幅：+3.2%\r\n点击查看最新实时行情。"
        # }

        template_id = 'mkqi-L1h56mH637vLXiuS_ulLTs1byDYYgLBbSXQ65U'
        the_json = {
            "touser": to_user,
            "template_id": template_id,
            "url": "http://www.foolcage.com",
            "data": {
                "first": {
                    "value": title,
                    "color": "#173177"
                },
                "keyword1": {
                    "value": security_name,
                    "color": "#173177"
                },
                "keyword2": {
                    "value": current_price,
                    "color": "#173177"
                },
                "keyword3": {
                    "value": '{:.2%}'.format(change_pct),
                    "color": "#173177"

# Path: fooltrader/settings.py
# SMTP_HOST = 'smtpdm.aliyun.com'
# 
# SMTP_PORT = '80'
# 
# EMAIL_PASSWORD = ''
# 
# EMAIL_USER_NAME = ''
# 
# WEIXIN_APP_ID = ""
# 
# WEIXIN_APP_SECRECT = ""


# Path: fooltrader/bot/action/msg_action.py
import email
import json
import logging
import smtplib
import requests
import schedule
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from fooltrader.settings import SMTP_HOST, SMTP_PORT, EMAIL_PASSWORD, EMAIL_USER_NAME, WEIXIN_APP_ID, WEIXIN_APP_SECRECT

        # {
        #     "template_id": "mkqi-L1h56mH637vLXiuS_ulLTs1byDYYgLBbSXQ65U",
        #     "title": "涨跌幅提醒",
        #     "primary_industry": "金融业",
        #     "deputy_industry": "证券|基金|理财|信托",
        #     "content": "{{first.DATA}}\n股票名：{{keyword1.DATA}}\n最新价：{{keyword2.DATA}}\n涨跌幅：{{keyword3.DATA}}\n{{remark.DATA}}",
        #     "example": "您好，腾新控股最新价130.50元，上涨达到设置的3.2%\r\n股票名：腾讯控股（00700）\r\n最新价：130.50元\r\n涨跌幅：+3.2%\r\n点击查看最新实时行情。"
        # }

        template_id = 'mkqi-L1h56mH637vLXiuS_ulLTs1byDYYgLBbSXQ65U'
        the_json = {
            "touser": to_user,
            "template_id": template_id,
            "url": "http://www.foolcage.com",
            "data": {
                "first": {
                    "value": title,
                    "color": "#173177"
                },
                "keyword1": {
                    "value": security_name,
                    "color": "#173177"
                },
                "keyword2": {
                    "value": current_price,
                    "color": "#173177"
                },
                "keyword3": {
                    "value": '{:.2%}'.format(change_pct),
                    "color": "#173177"

                },