diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1370c46e..b62f87c5 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -659,6 +659,14 @@ "message": "Account email address", "description": "" }, + "placeholder_mail_text_body_or_selected": { + "message": "Mail body or selected text", + "description": "" + }, + "placeholder_mail_html_body_or_selected": { + "message": "Mail body or selected HTML", + "description": "" + }, "prefs_OptionText_placeholders_use_default_value": { "message": "Placeholders: use default value", "description": "" @@ -1000,7 +1008,7 @@ "description": "" }, "prompt_get_calendar_event_full_text": { - "message": "Extract all relevant details required to generate a calendar event from the following text. The extracted information should include:\n- Event Title\n- Start Date and Time (including timezone, if specified)\n- End Date and Time (including timezone, if specified)\n- Full day (if mentioned)\n- Attendees\nEnsure the data is formatted clearly and consistently so that it can be directly used for creating a calendar event.\nIf there are relative time references, consider that the date and time of the email are \"{%mail_datetime%}\". Calculate the start date and time based on this reference. If the calculated start date and time are earlier than \"{%current_datetime%}\", recalculate the start date and time using \"{%current_datetime%}\" as the base.\nIf the duration is not specified, set it to one hour.\nThese are the attendees: {%author%}, {%recipients%}, {%cc_list%}. If present, exclude my address: {%account_email_address%}.\nIf you're not able to get one or more of the required information, please respond with an empty string.\nGenerate a response in JSON format only. Do not include any additional text or explanations; provide only the JSON. Here is the format to be used:\n{\n\"startDate\": \"YYYYMMDDTHHMMSS\",\n\"endDate\": \"YYYYMMDDTHHMMSS\",\n\"summary\": \"Calendar event summary here\",\n\"forceAllDay\": false,\n\"attendees\": [attendee1@example.com,attendee2@example.com,attendee3@example.com]\n}\nHere's the text:\"{%selected_text%}\"", + "message": "Extract all relevant details required to generate a calendar event from the following text. The extracted information should include:\n- Event Title\n- Start Date and Time (including timezone, if specified)\n- End Date and Time (including timezone, if specified)\n- Full day (if mentioned)\n- Attendees\nEnsure the data is formatted clearly and consistently so that it can be directly used for creating a calendar event.\nIf there are relative time references, consider that the date and time of the email are \"{%mail_datetime%}\". Calculate the start date and time based on this reference. If the calculated start date and time are earlier than \"{%current_datetime%}\", recalculate the start date and time using \"{%current_datetime%}\" as the base.\nIf the duration is not specified, set it to one hour.\nThese are the attendees: {%author%}, {%recipients%}, {%cc_list%}. If present, exclude my address: {%account_email_address%}.\nIf you're not able to get one or more of the required information, please respond with an empty string.\nGenerate a response in JSON format only. Do not include any additional text or explanations; provide only the JSON. Here is the format to be used:\n{\n\"startDate\": \"YYYYMMDDTHHMMSS\",\n\"endDate\": \"YYYYMMDDTHHMMSS\",\n\"summary\": \"Calendar event summary here\",\n\"forceAllDay\": false,\n\"attendees\": [attendee1@example.com,attendee2@example.com,attendee3@example.com]\n}\nHere's the text:\"{%mail_text_body_or_selected%}\"", "description": "" }, "Summarize_prompt_prefs_title": { diff --git a/js/mzta-placeholders.js b/js/mzta-placeholders.js index bfb841c7..d8b63008 100644 --- a/js/mzta-placeholders.js +++ b/js/mzta-placeholders.js @@ -267,6 +267,24 @@ const defaultPlaceholders = [ is_default: "1", is_dynamic: "0", enabled: 1, + }, + { + id: 'mail_text_body_or_selected', + name: "__MSG_placeholder_mail_text_body_or_selected__", + default_value: "", + type: 0, + is_default: "1", + is_dynamic: "0", + enabled: 1, + }, + { + id: 'mail_html_body_or_selected', + name: "__MSG_placeholder_mail_html_body_or_selected__", + default_value: "", + type: 0, + is_default: "1", + is_dynamic: "0", + enabled: 1, } ]; @@ -517,6 +535,12 @@ export const placeholdersUtils = { case 'selected_html': finalSubs['selected_html'] = placeholdersUtils.failSafePlaceholders(selection_html); break; + case 'mail_text_body_or_selected': + finalSubs['mail_text_body_or_selected'] = placeholdersUtils.failSafePlaceholders(selection_text || body_text); + break; + case 'mail_html_body_or_selected': + finalSubs['mail_html_body_or_selected'] = placeholdersUtils.failSafePlaceholders(selection_html || msg_text?.html); + break; case 'author': finalSubs['author'] = placeholdersUtils.failSafePlaceholders(curr_message.author); break;