Re: Put a button in an email that won't open a web page
My bad I misunderstood your question. It seems what you want is for the user to be able to click on the button in the email and only sent an email and be taken to a webpage that first time. After that any click on button in the email would only send an email. Yes the URL will send the user to a browser by default. Then if you do not respond (you do not have to but the browser will timeout at some point) it would be disconcerting to the user. So yes best thing is to present an HTML page. I do not think there is a way to not have the browser timeout if webserver does not respond. So since the user is always sent to the browser you should respond appropriately with an HTML page. Emails can be sent irregardless of that. Cheers Jim Labos - infobase - Jim Labos - infobase -- View this message in context: http://4d.1045681.n5.nabble.com/Put-a-button-in-an-email-that-won-t-open-a-web-page-tp5753240p5753276.html Sent from the 4D Tech mailing list archive at Nabble.com. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Put a button in an email that won't open a web page
Hi Jim, How do you avoid responding with a web page? Can you give a simple example for me to start with? For example, the first time they click the Confirm button in an email, we might still open a web page to give them some feedback. Then, they can decide they don't want the extra feedback of the web page, and can wait for the "receipt" email. From then on, we would like to prevent the web page from opening when they click the Confirm button in the email. Thanks, Jim On Fri, Jul 21, 2017 at 1:24 PM, Jim Labos - infobase via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Without knowing the details of what you are doing I can only say that the > button will just act like any URL to a server. What you do with the URL and > respond to it is entirely up to how the server responds. > > I regularly send out emails with buttons linked to a URL. I use 4D > Webserver > and trap the URL and depending on the encoding parts I run whatever code > required. > > I need not respond with a Web page at all. In that case however the user > may > get confused if you have not alerted them previously (in the email) of what > to expect when clicking on the button. > > If for instance the button text reads: "Click here to receive an email from > us" with added instructions below or above the button stating that the > email > may take up to 24 hours to come (or whatever time interval you deem fit). > > Of course all this is dependent on you having control of what the Web > server does. > > Cheers > > Jim Labos - infobase > > > > > - > Jim Labos - infobase > -- > View this message in context: http://4d.1045681.n5.nabble. > com/Put-a-button-in-an-email-that-won-t-open-a-web-page- > tp5753240p5753272.html > Sent from the 4D Tech mailing list archive at Nabble.com. > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** > ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Put a button in an email that won't open a web page
Without knowing the details of what you are doing I can only say that the button will just act like any URL to a server. What you do with the URL and respond to it is entirely up to how the server responds. I regularly send out emails with buttons linked to a URL. I use 4D Webserver and trap the URL and depending on the encoding parts I run whatever code required. I need not respond with a Web page at all. In that case however the user may get confused if you have not alerted them previously (in the email) of what to expect when clicking on the button. If for instance the button text reads: "Click here to receive an email from us" with added instructions below or above the button stating that the email may take up to 24 hours to come (or whatever time interval you deem fit). Of course all this is dependent on you having control of what the Web server does. Cheers Jim Labos - infobase - Jim Labos - infobase -- View this message in context: http://4d.1045681.n5.nabble.com/Put-a-button-in-an-email-that-won-t-open-a-web-page-tp5753240p5753272.html Sent from the 4D Tech mailing list archive at Nabble.com. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Put a button in an email that won't open a web page
Hi Lutz, I agree completely - having the short message pop up is good instant feedback. And although the email is sent immediately, you never know if it might be delayed or blocked. I've made this argument with the customer, but I didn't think of the possibility of delayed or blocked email, which will undoubtedly happen. In this case, the some of the recipients are going to be getting a lot of these emails, and are looking for minimizing the actions they need to take. We can't stop the web page from coming up, but we can start out by having it stay open, and let the user close it. We can give the users the option to have it automatically close after N seconds in the future (assuming window.close() or similar works going forward). It can also remind them to watch for the email and make sure it isn't caught in their spam folder. A good 2 cents! - Jim On Fri, Jul 21, 2017 at 3:30 AM, Epperlein, Lutz (agendo) via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hi Jim, > > Sorry if this this is not a very helpful answer for you, but .. > > I think it isn't a very good idea to have a button (in an email or > whatever) the user have to press and nothing happens immediately. Some > seconds, minutes, hours later the user gets the answer, usually he doesn't > realize what's going on, I think. And opening and closing a browser window > immediately maybe will lead to calls to the IT department: "I think my > workstation is infected" > > A suggestion: The browser window will open with a short message, informing > the user that he will get an acknowledgment email later. The email is for > the records and contains additional information. > > But maybe I'm totally wrong with these advices because I don't know your > exact use case, the context and so on ... So these are only my 2 cents > > Regards > Lutz > > > > -Original Message- > > From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Jim > Hays via > > 4D_Tech > > Sent: Thursday, July 20, 2017 8:33 PM > > To: 4D iNug Technical <4d_tech@lists.4d.com> > > Cc: Jim Hays> > Subject: Put a button in an email that won't open a web page > > > > TL;DR: > > > > Click a button in a typical marketing email. It always opens a web page. > > Is there any way to have the button click send a message to a (web) > server > > without having a web page open? > > > > > > Details: > > > > Send an email with a button in it. > > The recipient clicks the button to confirm an agreement. > > The 4D Server then sends a followup email indicating the confirmation is > > received. > > > > The email is in HTML format. > > The button has an href that points back to the 4D web server. > > 4D server sends the confirmation received email. > > > > That's all working nicely. > > > > Our href looks like this: > > http://10.0.0.8:8080/confirm?539D36962A0A45478F0538EE894A4D > 5358CBB76FAED5 > > 9F44B32DEEA97B22F3B4 > > " > > > > Because we are doing a simple web call, the user's default browser opens > up > > with a web page. > > This is what we are trying to avoid. > > > > As far as I know, stuffing javascript into an html email is a big no-no. > > (We don't know what mail client the recipient will use.) > > > > > > Bonus if you read this far - some cool HTML email tools! > > https://mjml.io > > markup language to generate compatible html mail > > > > https://litmus.com > > test html in up to 70 mail clients > > > > > > Thanks for any ideas! > > > > Jim Hays > > ** > > 4D Internet Users Group (4D iNUG) > > FAQ: http://lists.4d.com/faqnug.html > > Archive: http://lists.4d.com/archives.html > > Options: http://lists.4d.com/mailman/options/4d_tech > > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > > ** > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** > ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Put a button in an email that won't open a web page
Hi Tim, Thanks for the info. That follows everything I've read so far. It seems to me that the action when the user clicks is dependent on the mail client, and that's the rub. Only basic web functions are going to be generally available. I'm doing something similar now regarding closing the browser window. [Just like your next message that just came in.] This works in Edge, Chrome, Safari, and iOS Safari, but not Firefox. function loaded() { window.setTimeout(CloseMe, 2000); } function CloseMe() { window.open('','_parent',''); window.close(); } then: On Thu, Jul 20, 2017 at 3:23 PM, Timothy Penner via 4D_Tech < 4d_tech@lists.4d.com> wrote: > > Is there any way to have the button click send a message to a (web) > server without having a web page open? > > If you were just trying to track if the message was displayed I would say > use an IMG tag instead of the A tag, that would allow your web server to > get the request each time the IMG tag is displayed without a web browser > being opened. Of course this would not work if the email client is > configured to not display images or receive in plain text. > > I don’t think the IMG tag approach would work properly for a 'click here > to confirm/agree' button. > I think you will need to link to an actual page using an A tag for that > button to respond to a click event. > > You could include JavaScript in the HTML response that 4D sends back to > close the window, > For example, make sure that http://10.0.0.8:8080/confirm? > 539D36962A0A45478F0538EE894A4D5358CBB76FAED59F44B32DEEA97B22F3B4 returns > HTML that runs window.close on load. > But this will still open the web browser, and if the web browser has > JavaScript disabled then the window would not close. > > -Tim > > > > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: Put a button in an email that won't open a web page
Regarding my suggesting for using JavaScript to close the window, it looks modern browsers no longer allow JavaScript to close windows it did not open. Due to security concerns, the old behavior of allowing JavaScript to close the current window instance is no longer allowed. For this to work the window must be script-closable: See https://developer.mozilla.org/en-US/docs/Web/API/Window/close and https://www.w3.org/TR/html5/browsers.html#script-closable To workaround this limitation you just need to use JavaScript to open a url in the current window instance, then the current window instance can be closed by the script. So your response would need to include something like this: window.open('','_self').close() More info about this workaround is here: https://stackoverflow.com/a/18776480/5971390 Of course, browser security can change and this may stop working. -Tim ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **