This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// web hook url取得はこちらから : https://qiita.com/vmmhypervisor/items/18c99624a84df8b31008 | |
var postUrl = "https://hooks.slack.com/services/hogehoge"; | |
var postChannel = "#general"; | |
function send_slack() { | |
// 未読の指定ラベル を検索 | |
var threads = GmailApp.search('from:noreply@peing.net is:unread'); | |
var count = threads.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="http://www.google-analytics.com/collect?v=1&tid=UA-xxxxxxxx-x&cid=smarby&t=event&ec=email&ea=open&el=20151027" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insertLastUpdated() { | |
var ss = SpreadsheetApp.getActiveSheet(); | |
var currentRow = ss.getActiveCell().getRow(); | |
var currentCell = ss.getActiveCell().getValue(); | |
var updateRange = ss.getRange('F' + currentRow) //更新日をいれる列をstringで指定。この場合はF列 | |
Logger.log(updateRange); | |
//更新日の記入 | |
if(currentRow>1){ | |
if(currentCell) { | |
updateRange.setValue(new Date()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//NameとFaceをランダムで取得して、Slackへ送る | |
function OSOJIKUN() { | |
var row = Math.floor(Math.random() * 5) + 2; | |
Logger.log(row); | |
var Name = sheetdata[row][0]; | |
var row2 = Math.floor(Math.random() * 5) + 2;//NameのrowをRandomで取得 | |
var Face = sheetdata[row2][1]; | |
var slackApp = SlackApp.create(slack["token"]);//FaceのrowをRandomで取得 | |
var Message = slackApp.postMessage(slack["ChannelId"], "```" + "今週のゴミ捨て当番は…" + Name + "!頼んだドン!" + Face + "```", {username : slack["userName"]}); | |
Logger.log(Message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Slackへ送る | |
var slackApp = SlackApp.create(slack["token"]); | |
var Slackpost = slackApp.postMessage(slack["groupId"],"```" + "\n" + "昨日のMarketing Quick Report" + "\n" + "オーダー件数:" + orderNum + "\n" + "オーダー単価:" + orderUnitPrice + "\n" + "会員登録数:" + signupNum + "\n" + "CPA:" + CPA + "\n" + "CPO:" + CPO + "\n" + "CVR:" + CVR + "%" + "\n" + "```", {username : slack["userName"]}); | |
return column; | |
} else { | |
} | |
column += 1; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- コンタクトフォームの送信先として使用する | |
- CRMを使っている場合には新しい顧客の連絡先を特定のチャンネルで共有するようにする | |
- アラート情報を特定のチャンネルに送信するようにする |