Skip to content

Commit

Permalink
feat(PublicFeedsPage): add config option for support email
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-cline committed Nov 16, 2023
1 parent 4d2b850 commit d246054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions configurations/default/server.yml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ application:
notifications_enabled: false
docs_url: http://conveyal-data-tools.readthedocs.org
support_email: [email protected]
public_gtfs_contact_email: [email protected]
port: 4000
data:
gtfs: /tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
import java.io.IOException;
import java.text.SimpleDateFormat;

import static com.conveyal.datatools.manager.DataManager.getConfigPropertyAsText;

/**
* Publish the latest GTFS files for all public feeds in a project.
*/
public class PublishProjectFeedsJob extends MonitorableJob {
public static final Logger LOG = LoggerFactory.getLogger(PublishProjectFeedsJob.class);

private Project project;
private static final String dataSupportEmail = getConfigPropertyAsText("application.public_gtfs_contact_email");

public PublishProjectFeedsJob(Project project, Auth0UserProfile owner) {
super(owner, "Generating public html for " + project.name, JobType.MAKE_PROJECT_PUBLIC);
Expand Down Expand Up @@ -54,6 +57,9 @@ public void jobLogic () {
r.append("<body>\n");
r.append("<h1>" + title + "</h1>\n");
r.append("The following feeds, in GTFS format, are available for download and use.\n");
if (dataSupportEmail != null) {
r.append(String.format("If you have inquiries, please contact us at: <a href=\"mailto:%1$s\">%1$s</a>", dataSupportEmail));
}
r.append("<ul>\n");
status.update("Ensuring public GTFS files are up-to-date.", 50);
project.retrieveProjectFeedSources().stream()
Expand Down

0 comments on commit d246054

Please sign in to comment.