Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 124

mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
11/06/12 10:11 AM (13 years ago)

Send Email Plugin

I need to be able to autofill the body of an email from the send email plugin. Seems like a natural extension of the send email plugin that David created. Anyone have any thoughts about the best way to do this? I have zero coding ability but I'm pretty good following directions. Any advice or feedback will be greatly appreciated!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
11/06/12 11:00 AM (13 years ago)
With iOS, it looks like you can use the "emailMessage" JSON parmeter to send the body of the email. Since there is no option for this parameter in the control panel, you could either "hard code" it to your BT_config.txt (requires making your app "offline") or you could use the JSON Snippet Keeper to create the whole screen like so: {"itemId": "7B1CEA94E39D849D6E4FFD9","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "JSON is your best friend!", "emailMessage":"Test body text"} I just tested this, and it works fine.
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/06/12 02:25 PM (13 years ago)
Thanks for the suggestions. Never used Snippet Keeper before. Is it really a simple copy and paste job?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
11/06/12 03:40 PM (13 years ago)
You need to know how to use it, of course. But once you learn, it is really simple. I've made a couple videos on youtube (search for JSON Snippet) under the username iDevDepot. And I'll be glad to help, if needed.
 
Kaybee
buzztouch Evangelist
Profile
Posts: 659
Reg: Sep 22, 2012
Perth, Australi...
44,690
like
11/06/12 05:15 PM (13 years ago)
@Stobe, if the control panel was updated to include this, then would it be possible? So could I update the index.php file on self hosting to get to be available on my self hosting?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
11/06/12 08:30 PM (13 years ago)
@Kaybee, yes, for self-hosted, if you know what you're doing, you can add the php to save the JSON parameter. The body text of the email plugin was disabled for technical reasons a while back. But if you only send plain text (not html) then it will work.
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/08/12 09:02 AM (13 years ago)
Thanks for the suggestions. Never used Snippet Keeper before. Is it really a simple copy and paste job?
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/08/12 09:34 AM (13 years ago)
Ok I'm gonna give this a try...I'm sure I'll be back with more questions. Thanks!
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/16/12 12:52 PM (13 years ago)
Ok let me say that JSON Snippet Keeper is Awesome! I've got it working but I'm running into a slight problem. I'd like to have the email auto-fill the following form: Name: Phone Number: Best time to contact: Ok to leave a message: How do I make it look like this in JSON?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
11/16/12 01:06 PM (13 years ago)
Do you mean how would you format the text to be multi-line? I think you could use escape codes for that? There's probably someone around here that's more knowledgable than myself on those, lol.
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/16/12 01:16 PM (13 years ago)
Right. Each on a new line. Any thoughts?
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/16/12 03:12 PM (13 years ago)
Ok I got it. Just insert a "\\n" where you want the new line to begin. {"itemId": "8807CA490E504B6E47C8E72","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "App Request", "emailMessage":"Name:\\nPhone Number:\\nBest time to reach you:\\nOk to leave a message:"}
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/16/12 03:52 PM (13 years ago)
Ok I got it. Just insert a "\\n" where you want the new line to begin. {"itemId": "8807CA490E504B6E47C8E72","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "App Request", "emailMessage":"Name:\\nPhone Number:\\nBest time to reach you:\\nOk to leave a message:"}
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/19/12 08:29 AM (13 years ago)
Ok I got it. Just insert a "\\n" where you want the new line to begin. {"itemId": "8807CA490E504B6E47C8E72","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "App Request", "emailMessage":"Name:\\nPhone Number:\\nBest time to reach you:\\nOk to leave a message:"}
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/19/12 08:33 AM (13 years ago)
Ok I got it. Just insert a "\\n" where you want the new line to begin. {"itemId": "8807CA490E504B6E47C8E72","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "App Request", "emailMessage":"Name:\\nPhone Number:\\nBest time to reach you:\\nOk to leave a message:"}
 
mjmccreary
I hate code!
Profile
Posts: 50
Reg: Apr 17, 2012
Chicago
5,000
like
11/19/12 08:36 AM (13 years ago)
Ok I got it. Just insert a "\\n" where you want the new line to begin. {"itemId": "8807CA490E504B6E47C8E72","itemType": "BT_sendEmail","itemNickname": "Email Me","emailToAddress": "[email protected]","emailSubject": "App Request", "emailMessage":"Name:\\nPhone Number:\\nBest time to reach you:\\nOk to leave a message:"}
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.