@@ -1936,6 +1936,8 @@ def download_list_html(
19361936 view_icon : str = "eye" ,
19371937 download_label : str = "Download" ,
19381938 download_icon : str = "download" ,
1939+ send_label : str = "Send" ,
1940+ send_icon : str = "envelope" ,
19391941 zip_label : Optional [str ] = None ,
19401942 zip_icon : str = "file-archive" ,
19411943 append_matching_suffix : bool = True ,
@@ -1958,10 +1960,12 @@ def download_list_html(
19581960 view_icon (str): Icon for the 'view' button, default is "eye".
19591961 download_label (str): Label for the 'download' button, default is "Download".
19601962 download_icon (str): Icon for the 'download' button, default is "download".
1963+ send_label (str): Label for the 'send' button. Default is "Send".
1964+ send_icon (str): Fontawesome icon for the 'send' button. Default is "envelope".
19611965 zip_label (Optional[str]): Label for the zip option. If not provided, uses the generic template for `self.zip_label` ("Download all").
19621966 zip_icon (str): Icon for the zip option, default is "file-archive".
19631967 append_matching_suffix (bool): Flag to determine if matching suffix should be appended to file name, default is True.
1964- include_email (bool): Flag to include an email option, default is False.
1968+ include_email (bool): Flag to include an option, default is False.
19651969 use_previously_cached_files (bool): Flag to use previously cached files (e.g., made in background) if defined. default is False.
19661970 include_full_pdf (bool): Flag to include a full PDF option, default is False.
19671971 full_pdf_label (Optional[str]): Label for the full PDF option. If not provided, uses the generic template for `self.full_pdf_label` ("Download all").
@@ -2071,7 +2075,7 @@ def download_list_html(
20712075 html += table_row (full_pdf_label , full_pdf_button )
20722076
20732077 if include_email :
2074- html += self .send_email_table_row (key = key )
2078+ html += self .send_email_table_row (key = key , send_label = send_label , send_icon = send_icon )
20752079
20762080 html += "\n </div>"
20772081
@@ -2150,13 +2154,15 @@ def download_html(
21502154
21512155 return html
21522156
2153- def send_email_table_row (self , key : str = "final" ) -> str :
2157+ def send_email_table_row (self , key : str = "final" , send_label : str = "Send" , send_icon : str = "envelope" ) -> str :
21542158 """
21552159 Generate HTML doc table row for an input box and button that allows
21562160 someone to send the bundle to the specified email address.
21572161
21582162 Args:
21592163 key (str): A key used to identify which version of the ALDocument to send. Defaults to "final".
2164+ send_label (str): Label for the 'send' button. Default is "Send".
2165+ send_icon (str): Icon for the 'send' button. Default is "envelope".
21602166
21612167 Returns:
21622168 str: The generated HTML string for the table row.
@@ -2189,7 +2195,7 @@ def send_email_table_row(self, key: str = "final") -> str:
21892195 """
21902196
21912197 # "Send" button for the 2nd column of the table row
2192- send_button = f'{ action_button_html (javascript_string , label = "Send" , icon = "envelope" , color = "primary" , size = "md" , classname = "al_send_email_button al_button" , id_tag = al_send_button_id )} '
2198+ send_button = f'{ action_button_html (javascript_string , label = send_label , icon = send_icon , color = "primary" , size = "md" , classname = "al_send_email_button al_button" , id_tag = al_send_button_id )} '
21932199
21942200 # Whole row put together
21952201 html = f"""
@@ -2206,8 +2212,10 @@ def send_button_to_html(
22062212 email : str ,
22072213 editable : bool = False ,
22082214 template_name : str = "" ,
2209- label : str = "Send" ,
2210- icon : str = "envelope" ,
2215+ label : Optional [str ] = None ,
2216+ send_label : str = "Send" ,
2217+ icon : Optional [str ] = None ,
2218+ send_icon : str = "envelope" ,
22112219 color : str = "primary" ,
22122220 key : str = "final" ,
22132221 ) -> str :
@@ -2220,14 +2228,23 @@ def send_button_to_html(
22202228 email (str): The recipient's email address.
22212229 editable (bool, optional): Flag indicating if the bundle is editable. Defaults to False.
22222230 template_name (str, optional): The name of the template to be used. Defaults to an empty string.
2223- label (str, optional): The label for the button. Defaults to "Send".
2224- icon (str, optional): The Fontawesome icon for the button. Defaults to "envelope".
2231+ label (Optional[str]): The label for the send button. Defaults to
2232+ `send_label`.
2233+ send_label (str): Alias for `label`. Matches other methods.
2234+ Defaults to "Send".
2235+ icon (Optional[str]): The Fontawesome icon for the send button.
2236+ Defaults to `send_icon`.
2237+ send_icon (str): Alias for `icon`. Matches other methods. Defaults
2238+ to "envelope".
22252239 color (str, optional): The Bootstrap color of the button. Defaults to "primary".
22262240 key (str, optional): A key used to identify which version of the ALDocument to send. Defaults to "final".
22272241
22282242 Returns:
22292243 str: The generated HTML string for the button.
22302244 """
2245+ label = label or send_label
2246+ icon = icon or send_icon
2247+
22312248 if not self .has_enabled_documents ():
22322249 return "" # Don't let people email an empty set of documents
22332250 if not hasattr (self , "_cached_get_email_copy" ):
@@ -2261,6 +2278,10 @@ def send_button_html(
22612278 key : str = "final" ,
22622279 show_editable_checkbox : bool = True ,
22632280 template_name : str = "" ,
2281+ label : Optional [str ] = None ,
2282+ send_label : str = "Send" ,
2283+ icon : Optional [str ] = None ,
2284+ send_icon : str = "envelope" ,
22642285 ) -> str :
22652286 """
22662287 Generate HTML for an input box and button that allows someone to send the bundle
@@ -2276,10 +2297,21 @@ def send_button_html(
22762297 Defaults to True.
22772298 template_name (str, optional): Name of the template variable that is used to fill
22782299 the email contents. By default, the `x.send_email_template` template will be used.
2300+ label (str, optional): The label for the send button. Defaults to
2301+ `send_label`. Matches other methods.
2302+ send_label (str): Alias for `label`. Matches other methods.
2303+ Defaults to "Send".
2304+ icon (str, optional): The Fontawesome icon for the send button.
2305+ Defaults to `send_icon`. Matches other methods.
2306+ send_icon (str): Alias for `icon`. Matches other methods. Defaults
2307+ to "envelope".
22792308
22802309 Returns:
22812310 str: The generated HTML string for the input box and button.
22822311 """
2312+ label = label or send_label
2313+ icon = icon or send_icon
2314+
22832315 if not self .has_enabled_documents ():
22842316 return "" # Don't let people email an empty set of documents
22852317 if not hasattr (self , "_cached_get_email_copy" ):
@@ -2327,7 +2359,7 @@ def send_button_html(
23272359 <input value="{ user_info ().email if user_logged_in () else '' } " alt="Email address for document" class="form-control" type="email" size="35" name="{ al_email_input_id } " id="{ al_email_input_id } ">
23282360 </span>
23292361
2330- { action_button_html (javascript_string , label = "Send" , icon = "envelope" , color = "primary" , size = "md" , classname = "al_send_email_button" , id_tag = al_send_button_id )}
2362+ { action_button_html (javascript_string , label = label , icon = icon , color = "primary" , size = "md" , classname = "al_send_email_button" , id_tag = al_send_button_id )}
23312363
23322364 </div>
23332365 """
0 commit comments