Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending via JS a WIDELY varying amount of information via email

Status
Not open for further replies.

EdwardMartinIII

Technical User
Sep 17, 2002
1,655
0
0
US
Big picture: I have technicians worldwide who move equipment around. For each "move," they're supposed to have a notification that they have "actioned" all these items of equipment in a certain way. Some actions might be "removing from dock." Some actions might be "delivering to client" Some actions might be "error-corrected this data." For each transaction, that list can include anywhere from one item to a few hundred items. Some transactions may include SVG data because of a signature component. The point is that the length can vary a LOT. And we keep adding actions.

In the past, I have been able to use mailto links fine, but in this case, the character count can vary wildly and often go way over the limit of the mailto link.

I have two choices of "hosting" solution:

[ul]
[li]Everyone gets a little local copy of the "site" on their computer, and we are satisfied with information being emailed around.[/li]
[li]I post the site to a Sharepoint location (they will let me host a site on SharePoint), change the pages to "ASPX" and try to find a solution that uses that resource (I know very little about operating in Sharepoint, so I don't even know if I can do it)[/li]
[li]I host all of this on a private server with a full stack until my client discovers it and fires me brutally for going "outside the fence."[/li]
[li]Some solution I don't know yet.[/li]
[/ul]

Other than the above, I have no server-side tools. This client will never let me install (for example) a stack somewhere. So there is no CGI solution.

So, at a certain point in my code, I have a single big JS variable, call it EmailString.

I can put EmailString into its own web page, and there it is. But I can't put EmailString into an email if it's too long.

Exploratory questions:
[ol 1]
[li]Can I open an email and then shovel data into it line-by-line instead of precomposing the email string?[/li]
[li]Can I open an email and tell it "for the body, send the contents of this other window" without violating the mailto link character limit?[/li]
[/ol]

I'm open to suggestions/ideas/etc., of course. :)


[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Addendum: I currently use email because then I can quickly search through emails to locate a specific transaction. And it lets everyone who wants to know this data also know what's happening in real time (they get added as CC).

[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Hi

Is not really clear to me where is triggered the e-mail sending. "I have a single big JS variable" -- Have it in a HTML document in a browser or is that some SharePoint thing ( absolutely no idea about it ) ? If is a HTML document, from where it is loaded and who wrote it ? Is the big JavaScript value put together in the browser or comes ready to use from server side ? Is the value only sent away or also gets saved somewhere ? Uploading the content to a hosting service or using different transport technology ( just thinking to Slack, not recommending it ) would also be considered violation ?


Feherke.
feherke.github.io
 
I can understand not knowing the childhood of EmailString, but don't worry -- it's a JavaScript variable and I built in in my JS script. It can range from 100 characters to pretty damn big. I wrote everything.

But once I realized I was hitting a roughly 2000-character limit on the email mailto: variable, I kinda hung that part of the project up. To put it in terms of my project, that means the technicians can't scan more than about fifty items at a time, and that's just not going to be adequate.

The only way that would work was if I could -- via HTML/JS -- keep shoveling data into an email. But I think at this point, that dog don't hunt.

So instead, I switched to re-coding the whole thing in VBA under Excel. All my technicians can run Excel on their machines, it can feed anything I want into Outlook (including attachments, which the JS mailto command absolutely forbids), and I can code it a bit quicker because the previous tool was in VBA. Also, pretty much nothing that Excel can do will be forbidden by the Admin group, so I have that going for me. :)



[monkey] Edward [monkey]

"Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top