Mailto not working...

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

Hi, I've probably made a simple mistake but can't work out what it is; the following doesn't open email:

"myemail@bti.com".."?".."subject="..game.short title.."&body="..game.long text

Any help appreciated thanks.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Not sure it will make a difference, but could you combine whole first part into "myemail@bti.com?subject=".

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    @jamie_c Hi Jamie, thanks, I'll try that. Though to say, it works fine up until I add ".."&body="..game.long text"

    Edit: that didn't work unfortunately.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    Along those lines, I did try "&body=game.long text" - the email opened showing the correct subject but the body text says: vars['game.attributes.id246985']

    Also tried my original way with text in place of the attribute and it worked.... so it seems there's a problem with using an attribute for body copy in mailto... shame. Hope there's a solution...

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited January 2015

    @gyroscope, I had posted a mailto sample in the thread below last summer. It still seems to work fine, it uses table data though. Maybe it will help.

    http://forums.gamesalad.com/discussion/comment/483648#Comment_483648

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Thanks, Jamie, I've just discovered that and it's helped me work out the problem I'm having: mailto needs %20 for spaces - it can't deal with a text attribute without them, nor a table entry.

    So I'll have to add %20 to the saved attribute every time a user presses space. A bit of a nuisance, but workable.

    Thanks again for your help. :smile:

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Cool, glad you got it working at least. :)

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @gyroscope, you can use the textReplaceAll function to prepare the text at the time of sending.

    textReplaceAll(game.yourTextString," ","%%20")

    Note the double "%".

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    Hi @Hopscotch - would you believe I've just this minute tried textReplace all - and was downhearted that it didn't work - but now I see you need the double % - excellent, much pleased, thank you! :smiley:

    Edit: can't seem to get that to work either (works with characters but not space)- are you using option-space for the space, or something different, I wonder?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Sorted it: I can have the user add a + for each space, have the space show normally on screen, then replace the + signs with "%%20" for output via email.

    Good stuff, thanks again, @Hopscotch. :smile:

  • ArmellineArmelline Member, PRO Posts: 5,421

    @gyroscope I just stumbled upon this thread and you don't need to do the + business - make a self attribute, type a space into it, and use that as the search string. Alt-Space and a genuine space are different characters, but passing the space through an attribute lets you search for a genuine space.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited February 2016

    @Armelline Hi Ted, thanks for that. The app is finished and in the store now
    ( https://itunes.apple.com/gb/app/ambient-writer/id955139739?mt=8 )
    but that's useful for future reference.

    :smile:

Sign In or Register to comment.