{"id":26327448,"url":"https://github.com/zejiran/transactions-email-processor","last_synced_at":"2025-03-15T20:19:17.373Z","repository":{"id":168520836,"uuid":"642496890","full_name":"zejiran/transactions-email-processor","owner":"zejiran","description":"📬 Process a file containing debit and credit transactions on an account and generate a summary email with relevant information","archived":false,"fork":false,"pushed_at":"2023-05-23T09:18:36.000Z","size":256,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T15:47:49.841Z","etag":null,"topics":["email","file-processing","golang","transactions"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zejiran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-18T17:46:04.000Z","updated_at":"2023-05-23T05:18:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"59523c10-3900-4430-98e2-bc92649cbb2e","html_url":"https://github.com/zejiran/transactions-email-processor","commit_stats":null,"previous_names":["zejiran/transactions-email-processor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zejiran%2Ftransactions-email-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zejiran%2Ftransactions-email-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zejiran%2Ftransactions-email-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zejiran%2Ftransactions-email-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zejiran","download_url":"https://codeload.github.com/zejiran/transactions-email-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243785444,"owners_count":20347469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","file-processing","golang","transactions"],"created_at":"2025-03-15T20:19:16.785Z","updated_at":"2025-03-15T20:19:17.363Z","avatar_url":"https://github.com/zejiran.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transactions Email Processor\n\nThis project is a simple application that processes a file containing debit and credit transactions on an account and generates a summary email with relevant information. The application is built using Go and packaged into a Docker container for easy deployment.\n\n### Prerequisites\n\n- Docker\n\n### How to Run\n\n1. Pull the Docker image from the GitHub Container Registry:\n\n```shell\ndocker pull --platform linux/x86_64 ghcr.io/zejiran/transactions-email-processor:master\n```\n\n2. Create a `.env` file in the same directory as the Dockerfile with the following environment variables:\n\n```\nSENDER_MAIL=sender@gmail.com\nPASSWORD=secret-password\nRECIPIENT_MAIL=recipient@example.com\n```\n\nMake sure to replace the email addresses with your own sender and recipient addresses.\n\n3. Run the Docker container with the -v flag to mount a directory for input files:\n\n```shell\ndocker run --platform linux/x86_64 --env-file ./.env -v /\u003cabsolute-host-path\u003e/files:/files ghcr.io/zejiran/transactions-email-processor:master\n```\n\nThe `-v` flag maps the `files` directory on the host machine to the `/files` directory in the container. This allows you to provide input files from the host machine to the container.\n\n4. Alternatively, you can specify environment variables as command arguments:\n\n```shell\ndocker run --platform linux/x86_64 --env-file ./.env --env RECIPIENT_MAIL=new.recipient@example.com -v /\u003cabsolute-host-path\u003e/files:/files ghcr.io/zejiran/transactions-email-processor:master\n```\n\n### File Format\n\nThe input file should be in CSV format with the following columns:\n\n```\nId,Date,Transaction\n```\n\nEach row represents a transaction, where the `Id` is a unique identifier, `Date` is the date of the transaction in the format `MM/DD`, and `Transaction` is the transaction amount. Credit transactions are indicated with a plus sign (+) and debit transactions with a minus sign (-).\n\n### Customization\n\nThe email template used for generating the email body is located in the `email/dist/email_template.html` file. You can modify the template HTML to customize the email content, styling, and layout. Make sure to keep the placeholders for the dynamic data intact.\n\n### Configuration\n\nThe application requires the following environment variables to be set:\n\n- `SENDER_MAIL`: The email address of the sender.\n- `PASSWORD`: The password or app-specific password for the sender's email account.\n- `RECIPIENT_MAIL`: The email address of the recipient.\n\nMake sure to set these environment variables in the `.env` file before running the Docker container.\n\n### Repository Structure\n\n- `main.go`: The main Go application code that reads the input file, processes the transactions, generates the email body, and sends the email.\n- `Dockerfile`: The Dockerfile for building the Docker image of the application.\n- `email/src/email_template.heml`: The source HEML code used for creating the HTML template.\n- `email/dist/email_template.html`: The HTML template used for generating the email body.\n- `files/example_transactions.csv`: An example input file with debit and credit transactions.\n\n### Example Received Email\n\n\u003cimg width=\"300\" alt=\"example\" src=\"https://github.com/zejiran/transactions-email-processor/assets/30379522/0eb4f923-94d9-4234-9a2f-a87e2c8b511b\"\u003e\n\n### Notes\n\n- The email sending functionality is currently configured for Gmail. If you are using a different email provider, you may need to update the SMTP server details in the `sendEmail` function in `main.go`.\n\nPlease feel free to reach out if you have any questions or need further assistance!\n\n## License\n\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)\n\n- **[MIT license](LICENSE)**\n- Copyright 2023 © Juan Alegría.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzejiran%2Ftransactions-email-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzejiran%2Ftransactions-email-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzejiran%2Ftransactions-email-processor/lists"}