...Anyway, I got the part of sending the email down. I've got a script that will run and send the email in question. That's done. What's getting me is the conditions under which I call said script...
...I think either the mileage app or the adapter will work as a condition, if I can make it only go off when I'm at the office. In another words, only send email if it's M-F, 8-5 and location is Office and car charger is plugged in. Can I set a location without Tasker having to constantly turn on GPS to check my location? Is there an easier way to do this?
Tasker has a limit of 3 contexts for a profile, so what you're looking for can't be done as it normally would be.
First, a profile that will combine two contexts into one, using a variable:
Profile: Work Hours
Context: Day [Mon Tue Wed Thu Fri]
Context: Time [From 08:00] [To: 17:00]
Enter Task:
Variable Set [Name: %WORKHOURS] [Value: 1]
Exit Task:
Variable Clear [Name: %WORKHOURS]
Second, a profile to make sure GPS is on when you're powered. If GPS was off before you plugged in, it will be turned off when you unplug. You may want to purposely turn it off in an exit task to make sure that it doesn't end up draining your battery.
Profile: Power On
Context: Power [Source: Any]
Enter Task:
GPS [Set: On]
Now, the profile that actually sends the message.
Profile: I'm Out
Context: Variable Value [Name: %WORKHOURS] [Value: 1]
Context: Power [Source: Any] [Invert: Checked]
Location: Office [Network: On] [GPS: On]
Exit Task:
Stop If %WORKHOURS Isn't Set
<whatever actions you have working right now go here>
At first, the inverted power source context and use of an exit task instead of an enter task look wrong, but here's why it's right...
With a non-inverted power source context and an enter task, when you plug in your phone in the car, while still within the Office location, Tasker will activate the profile and send the message. This is what you want. But it will also activate the profile and send the message when you return to work with your phone plugged in, because as soon as you arrive at work, all of the contexts will become true.
As shown above, the profile will be active when you're at work and not plugged in. As soon as you plug in at work, the profile will become inactive, causing Tasker to send the message. But, when you're already plugged in and return to work, Tasker won't do anything. Then when you unplug at work, Tasker will activate the profile and the cycle starts all over again.
Additionally, once normal work hours have ended, the %WORKHOURS variable will be cleared, causing the "I'm Out" profile to exit. To account for this, the task will stop (and not send the message) if the %WORKHOURS variable isn't set.
This probably needs some tweaking, as I haven't tested any of it.