support sending PDF emails to a specific location type
This adds support for specifying a location type ID to send the emails to, similar to Email API.
I also fixed a bug ("do not trade" shouldn't prevent a PDF from going through) and rewrote the code to get the email in API4. the improved return values of API4 allowed me to remove a lot of try...catch
blocks.